Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^7: Reply

by tadman (Prior)
on Jun 08, 2001 at 04:38 UTC ( [id://86807]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Re: Reply

use Perl::Golf; sub re{ $_=pop;s/Re:\s*/\x01/g;s/Re(\d+):\s*/"\x01"x$1/eg;s/(\x01+)/"Re". length($1).": "/e;$_; }
As in: print re("Re: Re: Re: Re: Re: Re: Reply\n"); Returns: Re6: Reply

Replies are listed 'Best First'.
Re^8: Reply
by ChemBoy (Priest) on Jun 08, 2001 at 20:52 UTC

    Untested code, for shame... the following is for the simple case only: it breaks on "Re: Re^4: foo". But unfortunately, so does yours ;-)

    sub re {$a=()=pop=~/Re:\s*/g;"Re^$a: $'"}

    Unfortunately, this is short because it completely catipulates on a couple of issues, specifically "Re: Re^3: Foo" and "Re: bar". I've been trying to get the complex case to behave, and it hasn't been.

    Perhaps we should move this over to a more normal place for it?



    If God had meant us to fly, he would *never* have give us the railroads.
        --Michael Flanders

      No it doesn't(break Imean). He uses another format. He could easily include the ^ in his format. But you can't use his format either.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://86807]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-20 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found