> -----Original Message-----
> From: COLLINEAU Franck FTRD/DMI/TAM
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 25, 2001 4:52 AM
> To: Perl (E-mail)
> Subject: the line whitch follows $_
> 
> 
> Hi!
> 
> I have the follwing code:
> 
> while (<FILE>)
> {
>       push @line, $_ if(m/^<a name/);
> }
> 
> I don't exactly want that.
> I would like to push the line whitch is immediately after $_.

Just read the next line before you push:

   $_ = <FILE> && push @line, $_ if /^<a name/;

This assumes you don't want to push an undef if you
match on the last line. If you do, then

   $_ = <FILE>, push(@line, $_) if /^<a name/;

should work.

(I love your questions; they're so "pithy" :)

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

Reply via email to