in reply to (jeffa) Re: How to open sub FH when filename is passed to sub?
in thread How to open sub FH when filename is passed to sub?
I do make my sub hash, it gave me all the result, but it still tell me :
Use of uninitialized value at ./lx line 97.
Use of uninitialized value at ./lx line 97.
total 10 times Use of above context.
my sub like:
sub create_hash {
my $myhashname=shift;
my %myhashname=%_;
my @keys=@_;
unless(open(FH, ">$myhashname") ) {
print STDERR "Cannot open file\"$myhashname\"\n\n";
exit;}
@myhashname{@keys}=@mydnahash{@keys};
while (($k, $v)=each %myhashname){
print FH "$k=>$v, "};
close FH;
return %myhashname;
}
and I call sub like:
my %myeditedhash= create_hash('myeditedhash',@editedsites, @mydnahash{@editedsites});
print FH "$k=>$v, "}; is line 97.what is wrong? please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 3Re: How to open sub FH when filename is passed to sub?
by jeffa (Bishop) on May 08, 2002 at 05:01 UTC |