Help for this page

Select Code to Download


  1. or download this
    # run contents of "my_file" as a program
    perl my_file
    ...
    # command-line that prints the last 50 lines (expensively)
    perl -e '@lines = <>; print @lines[ $#lines .. $#lines-50' f1 f2 f3 ..
    +.
    
  2. or download this
    perl -000 -ne '$.=$a+1 and print "$.: doubled <$1> in\n$_\n" 
                   if /\b(\w+)\b\s+\b\1\b/gi;$a+=tr/\n//' file