Help for this page

Select Code to Download


  1. or download this
    # write.pl
    
    ...
        sleep 5;
        system('echo "hello world" > foo.txt');
    }
    
  2. or download this
    # copy.pl
    
    ...
    
    my $file1 = 'foo.txt';
    my $status = system("cp $file1 file2");
    
  3. or download this
    $ perl -w copy.pl
    cp: cannot stat `foo.txt': No such file or directory
    
  4. or download this
    # copy2.pl
    
    ...
        last if -e $file1 && ! qx/lsof $file1/;
    } 
    my $status = system("cp $file1 file2");