Help for this page

Select Code to Download


  1. or download this
    echo -e "abc\ndef\nghi\n" | perl -wlne '! /def/ and print "$_";'
    
  2. 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
    
  3. or download this
    perl -ne '}{ print $.'
    
  4. or download this
    perl -MO=Deparse,-x -ne '}{print$.'
    LINE: while (defined($_ = <ARGV>)) {  # -n
    ...
    {                                     # script body
        print $.;                         # script body
    }                                     # -n