--On Freitag, 19. Oktober 2001 12:49 -0400 Jeff 'japhy' Pinyan 
<[EMAIL PROTECTED]> wrote:

> On Oct 19, birgit kellner said:
>
>> my $header = "Joe Doe<br><br>The book I wrote yesterday";
>> my $title;
>> if ($header =~ /(^\S.+)(<br><br>)(\S.+$)/m) { $title = "$1: $3";}
>> print "$title\n";
>>
>> Is there a shorter, simpler, more efficient way to do this? I still need
>> $header later on as it is.
>
> You could do:
>
>   ($title = $header) =~ s/<br><br>/: /;
>
> That's a bit generalized -- I figure it will work as you expect it to in
> all cases.

I had thought of that, but believed that it will also perform the 
substitution on $header. I just tested it, and that doesn't seem to be the 
case. If that's true, there's the solution to my problem.

Birgit Kellner

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to