The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hullo Venerable Monks:
The program below opens a file, reads the last two lines, looks for a number, increments that number, then (I hope) appends the new lines to the bottom of the file. When I open $file for reading (and only reading) the program works, and prints out the new line to the screen. Making it read/write (+>>$file) gives me: Use of uninitialized value in pattern match (m//)...at line 15 I'm not sure why the simple addition of making the file read and writable empties my $line1 variable (opening with >$file destroys the file completely). Any clues? Full code bit: ------------------------ ------------------------- (It's probably ugly code, but I'm self-taught and have no Compsci background :F) Cheers, Flubb In reply to Filehandles vs Uninitialized Values in pattern match by Flubb
|
|