dottornomade has asked for the wisdom of the Perl Monks concerning the following question:
I just can not open some files I received.
When this simple chunk of code is executeduse IO::File; my @data; if (-e $file) { print "\nopen $file\n"; } if (my $fh->open("$file, r")) { print "I'm in\n"; @data = <$fh>; $fh->close; }
something goes wrong. The file is found (message "open filename" is printed, with filename being the correct name of the file), but then I get this error from the I0::File package:
Can't call method "open" on an undefined value
In other words, it's like there is no string assigned to the variable $file!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple to describe I/O problem
by Laurent_R (Canon) on Sep 01, 2014 at 20:38 UTC | |
by Anonymous Monk on Sep 01, 2014 at 20:54 UTC | |
by Laurent_R (Canon) on Sep 01, 2014 at 21:01 UTC | |
|
Re: simple to describe I/O problem
by Anonymous Monk on Sep 01, 2014 at 19:20 UTC | |
|
Re: simple to describe I/O problem
by Anonymous Monk on Sep 01, 2014 at 19:25 UTC | |
by AnomalousMonk (Archbishop) on Sep 01, 2014 at 19:46 UTC | |
by Anonymous Monk on Sep 01, 2014 at 20:04 UTC | |
by dottornomade (Initiate) on Sep 01, 2014 at 20:00 UTC |