[Israel.pm] file handle in hash?

Gabor Szabo szabgab at gmail.com
Mon Oct 22 11:35:38 PDT 2007


I don't know what does the second version
do but it should not do it.

%hh and $hh are different animals.

Do you have use strict; use warnings; enabled on this snippet?

Gabor

On 10/22/07, Shmuel Fomberg <semuelf at 012.net.il> wrote:
> 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.


-- 
Gabor Szabo
http://www.szabgab.com/
Perl Training in Israel  http://www.pti.co.il/
Profile: http://www.linkedin.com/profile?viewProfile=&key=82476



More information about the Perl mailing list