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.
In reply to Re: (jeffa) Re: How to open sub FH when filename is passed to sub?
by Anonymous Monk
in thread How to open sub FH when filename is passed to sub?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |