Help for this page

Select Code to Download


  1. or download this
    
    open FH, '+<afile';
    ...
    print FH $temp;
    truncate(FH, tell(FH));
    close(FH);
    
  2. or download this
    
    sub slurp {
    ...
    my $temp = slurp 'file.txt';
    $temp =~ s/2/two\nhi hello/;
    jot 'file.txt', $temp;