qwurx [shmem] ~> perl -MO=Deparse,-x -wlne '! /def/ and print "$_";'
BEGIN { $^W = 1; } # this is -w
BEGIN { $/ = "\n"; $\ = "\n"; } # this is -l
LINE: while (defined($_ = <ARGV>)) { # and here is what -n does...
chomp $_; # this belongs to -l
print "$_" unless /def/;
} # this belongs to -n too
-e syntax OK
The only line without comment is -e, i.e. your command line script body.
Here's another example - count lines, invented by Abigail:
perl -ne '}{ print $.'
The }{ construct - named eskimo greeting - splits the implicit while loop into a while loop block and a bare block:
perl -MO=Deparse,-x -ne '}{print$.'
LINE: while (defined($_ = <ARGV>)) { # -n
(); # script body - a noop
} # script body
{ # script body
print $.; # script body
} # -n
The bare block is used to output the current line number of the (special) filehandle ARGV.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
|