2008/2/20, Gunnar Hjalmarsson <[EMAIL PROTECTED]>: > > obdulio santana wrote: > > I offer you, a tiny version , > > > > @ll=split /^\s*\n/m,join '',<DATA>; > > print for @ll[1 .. $#ll - 1] ; > > <example data snipped> > > That code does not meet the OP's specification. Please consider a file > whose data looks like this: > > pri > dfsdfsa > > first > > asdf > asdf > asdf > > second > > last > > ass > sad > > -- > 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/
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); regards