Help for this page

Select Code to Download


  1. or download this
     LINE:
                    while (<>) {
                        ...             # your program goes here
                    } continue {
                        print or die "-p destination: $!\n";
                    }
    
  2. or download this
    perl -pi -e'BEGIN{$HEAD=shift@ARGV;open(HEAD);$main::head=<HEAD>}$_=$m
    +ain::head.$_ if $.==1' header-file file-to-be-edited
    
  3. or download this
    perl -e'($HEAD,$FILE)=@ARGV;open(HEAD);open(FILE);open($f,">$FILE.$$")
    +;print $f scalar <HEAD>,<FILE>;rename "$FILE.$$","$FILE"' header-file
    + file-to-be-edited