in reply to Uninitialized filehandles not as advertised?!
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': $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Uninitialized filehandles not as advertised?!
by Eli-Sko (Novice) on May 27, 2008 at 06:38 UTC |