It prints the 2rd line read, and 2nd line after every line of ----. Also, it prints the first line after the first line of ----.$ perl -MO=Deparse -e "while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^ +-+$/)}" while (defined($_ = <ARGV>)) { print $_ if $. == 2 or $& and not $s++; $. = 0 if /^-+$/; } -e syntax OK
In reply to Re: can you explain this perl oneliner
by Anonymous Monk
in thread can you explain this perl oneliner
by unixguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |