Help for this page

Select Code to Download


  1. or download this
    my $file = 'file.dat';
    open my $fh, '>', $file
        or die "Can't write '$file': $!";
    close $fh or die "Close error: $!";
    
  2. or download this
    system( "echo -n > file.dat" );
    
  3. or download this
    truncate 'file.dat', 0
        or die "Can't truncate file.dat: $!";