in reply to can you explain this perl oneliner
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
|
|---|