Works for me - maybe the problem is that you didn't show us where line 63 is in your code?
I used the following code and it runs without problems:
use strict; sub RLS_ropen($) { (@_ == 1) || die "RLS_ropen called w/ invalid argument list: ".sca +lar(@_)." params instead of 1"; my $name = $_[0]; unless ( $name ) { # invalid - null or empty file name return ""; } unless ( -e $name && -r $name ) { # file doesn't exits or is unreadable return ""; } open( my $dbh, "< $name"); return $dbh; } # end RLS_ropen my $fh = RLS_ropen "test.tmp";
... but maybe you want to be more explicit about things going bad, like for example, the file not existing:
open( my $dbh, "< $name") or die "Couldn't open database file '$name': $!";
In reply to Re: Uninitialized filehandles not as advertised?!
by Corion
in thread Uninitialized filehandles not as advertised?!
by Eli-Sko
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |