obdulio santana wrote:
Please let me know if everything is Ok.

@l = <DATA>;
@nl = map /^\s*\n/?1:0,@l;
map { print $l[$_] if ("$nl[$_ - 1]$nl[$_]$nl[$_ + 1]" eq "101" ) } (0 ..
$#nl);

1. It's no longer a tiny version. ;-)
2. It generates a warning. Aren't you using strictures and warnings??
3. I'd use a foreach loop instead of map in void context.

    foreach ( 1 .. $#nl-1 ) {
        print $l[$_] if ("$nl[$_ - 1]$nl[$_]$nl[$_ + 1]" eq "101" );
    }

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to