leelu has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Need help to fix the below error.
I m trying to write a file twice in the same script. Both the time i m trying to append the o/p file
$file = aaa.txt first time file mode open( my $testfile, "+>> $file" ) $!\n"; if ( -z "$testfile" ) ---> checking for empty file { write some o/p data close( $testfile );
second time time file process
open( my $testfile, "+>> $file" ) $!\n"; ---- ---- some condition check now adding some other info to the existing file close the file
Error:
First read is working for second read unable to open the file and appending the records.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Applying multiple file modes
by Athanasius (Archbishop) on May 25, 2015 at 03:33 UTC | |
by leelu (Initiate) on May 25, 2015 at 17:28 UTC | |
by Athanasius (Archbishop) on May 26, 2015 at 03:29 UTC | |
|
Re: Applying multiple file modes
by afoken (Chancellor) on May 25, 2015 at 06:50 UTC | |
|
Re: Applying multiple file modes
by wrog (Friar) on May 25, 2015 at 01:42 UTC | |
|
Re: Applying multiple file modes
by thanos1983 (Parson) on May 25, 2015 at 09:18 UTC |