in reply to Re: Unsuccessful and Uninitialized Value
in thread Unsuccessful and Uninitialized Value

I'd be interested in hearing ideas on how that error message could be made clearer.

"...(maybe you forgot to chomp?)"

;-)

Update: Looking closer at the OP's code, chomp is not the problem of course. The problem is the use of $/ which ikegami has noticed further down. But I still like my (joking) error message addition, as it sounds similar to the non-existant package/method error :)

Replies are listed 'Best First'.
Re^3: Unsuccessful and Uninitialized Value
by Anonymous Monk on Jun 05, 2006 at 17:13 UTC
    I did use chomp, and it still didn't work.
      Do you know what setting $/ does? If set to a reference to an integer, it reads in that many bytes (and in your case one or more of those bytes contains a newline). It does not merely set the "maximum" number of bytes read. Is that what you wanted (this would be appropriate for a fixed length format)? Or are you trying to read in the file one "line" at a time? What does one line of the file look like? Does one line contain one file name? Or more?