in reply to Unsuccessful and Uninitialized Value
The first lesson of debugging should be: If you get an error performing an operation, make sure the arguments you are using are the ones you think you are using.
In other words, start by making sure you are using the file name you think you are using.
In this case, the error message even gives you a major hint that the file name you are using is not the one you meant to use. Does the file name you wish to use really have a linefeed in it? No.
The problem is that when you read in a line from a file, the linefeed is not removed for your. Use chomp($record); to remove the trailing linefeed. (In effect, this extracts the file name from the $record.)
Update: Actaully, your problem is worse than that. You want to read lines from file $file, right? If so, get rid of local $/ = \$maxsize;. If not, then you have more work to do, because $record contain a partial file name, a single file name or multiple file names, but you assume it contains a single file name.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unsuccessful and Uninitialized Value
by Anonymous Monk on Jun 05, 2006 at 17:35 UTC | |
by ikegami (Patriarch) on Jun 05, 2006 at 18:16 UTC |