Help for this page

Select Code to Download


  1. or download this
    use File::Slurp:
    # get one file here, as $file
    ...
     $text =~ s/this/that/smg;
     rename($file, $bakfile);
     write_file($file, $text);
    
  2. or download this
    use Perl6::Slurp;        #<= only handles input at present
    use File::Slurp;         # permits writing.
    ...
    ... with renaming here ? (see above).
     write_file($file, $text);