in reply to Empty File Contnts before writing
The function you seek is... seek
use strict; use warnings; open my $fh, ">", "testing1.txt"; print $fh "stat"; seek $fh, 0, 0; print $fh "stat-updated"; close $fh; system cat => "testing1.txt";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Empty File Contents before writing
by Athanasius (Archbishop) on Feb 19, 2013 at 08:01 UTC | |
by gautamparimoo (Beadle) on Feb 19, 2013 at 09:47 UTC | |
by johngg (Canon) on Feb 19, 2013 at 10:04 UTC | |
by RichardK (Parson) on Feb 19, 2013 at 11:41 UTC | |
by johngg (Canon) on Feb 19, 2013 at 14:37 UTC | |
by locked_user sundialsvc4 (Abbot) on Feb 19, 2013 at 13:56 UTC | |
by gautamparimoo (Beadle) on Feb 20, 2013 at 05:43 UTC | |
by johngg (Canon) on Feb 20, 2013 at 23:17 UTC |