in reply to Re: Deleting on Files
in thread Deleting on Files

No, I am in a Windows box!

Replies are listed 'Best First'.
Re^3: Deleting on Files
by andye (Curate) on Feb 28, 2007 at 16:23 UTC
    Then you can still use Perl's open() in clobbering mode.
    Someone else has given an example.

    Best,

    andye

Re^3: Deleting on Files
by Anonymous Monk on Feb 28, 2007 at 16:23 UTC
    Could I do something like this:

    #!/usr/bin/perl use strict; use warnings; open (FILE, '+<', 'sample.txt') or die "Could not open sample.txt: + $!"; close (FILE) or die "Could not close sample.txt: $!";

      Using > instead of < will open it for writing and truncate the file.

      open (FILE, '>', 'sample.txt') or die "Could not open sample.txt: $!"; close (FILE) or die "Could not close sample.txt: $!";


      ___________
      Eric Hodges