Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The above code doesn't let me write to the same file even after I've untied it...Any ideas?use warnings; use strict; use Tie::File; my @file; my $template = 'test.dat'; my $o = tie @file, 'Tie::File', $template, recsep => "\r\n"; $o->flock; my @array = @file; untie @file; open (WRITE, ">test.dat"); foreach (@array) { if (/one/) { print WRITE "foo\n"; } } close WRITE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Writing to a Tied File ??
by Limbic~Region (Chancellor) on Jan 31, 2005 at 19:52 UTC | |
|
Re: Writing to a Tied File ??
by zentara (Cardinal) on Jan 31, 2005 at 19:51 UTC |