- or download this
echo -e "abc\ndef\nghi\n" | perl -wlne '! /def/ and print "$_";'
- or download this
qwurx [shmem] ~> perl -MO=Deparse,-x -wlne '! /def/ and print "$_";'
BEGIN { $^W = 1; } # this is -w
...
print "$_" unless /def/;
} # this belongs to -n too
-e syntax OK
- or download this
perl -ne '}{ print $.'
- or download this
perl -MO=Deparse,-x -ne '}{print$.'
LINE: while (defined($_ = <ARGV>)) { # -n
...
{ # script body
print $.; # script body
} # -n