Hi all,

I have a bunch of jokes that people have forwarded me over the years[1] and they 
all have really bad formatting [2].  I am lazy and want to do as much formatting 
of the jokes as I can automatically.  I have tried this piece of code to get rid 
of any '>' or whitespace charachters before the 'beginning' of each line of the 
text, but it just returns the same text as before:

foreach my $line (@body) {
        $_ = $line;
        s/^(?:>|\s)*(.*)$/$1/g;
        print;
}

Any ideas what I am doing wrong here[3]

TIA
Will.


[1] If anyone else has any I would be very grateful if they would forward them 
to me as I have started an archive.

[2] An example taken from one of the emails:

 > > Q:   Why aren't the England football team allowed to own a dog?
 > > A:   Because they can't hold on to a lead.
 > >
 > > Q:   What's the difference between the England team and a tea-bag?
 > > A:   The tea-bag stays in the cup longer.
 > >
 > > Q:   What's the difference between a packet of sellotape
 > and Phil Neville.
 > > A:   One's a glueless kit.
 > >
 > > Oxo were going to bring out a Euro 2000 commemorative cube
 > painted red,
 > white
 > > and blue in honour of the
 > > England squad.  But it was a laughing stock and crumbled in the box.

[3] I bet you do :-)


Reply via email to