[Israel.pm] file handle in hash?

Shmuel Fomberg semuelf at 012.net.il
Mon Oct 22 11:30:14 PDT 2007


Hello There.

Can anyone please explain to me why the following code does not work: 
-----Code 
open my $fh, "<", "filename"; 
my %hh = (handle => $fh); 
print $hh->{handle} "something"; 
-----End Code

while the slightly modified code does work?
-----Code
open my $fh, "<", "filename";
my %hh = (handle => $fh);
my $f2 = $hh->{handle};
print $f2 "something";
-----End Code

Aren't they suppose to be the same?

Thanks,
Shmuel.




More information about the Perl mailing list