D
dn.perl
Here is a piece of code whose output is : 'miami21 and miami21' :
#!/usr/bin/perl
use strict ;
my %hash = () ;
push @{$hash{florida}}, 'miami', 'miami01', 'miami02' ;
push @{$hash{florida}}, 'miami', 'miami21', 'miami22' ;
my $name = ${$hash{florida}}[4] . " and " . $hash{florida}[4] ;
print "name = $name \n" ;
How are $hash{florida}[4] and ${$hash{florida}}[4] the same thing?
I would have expected that indirection (I hope that is the correct
word for it) to produce something unintelligible or something
meaningless.
TIA.
#!/usr/bin/perl
use strict ;
my %hash = () ;
push @{$hash{florida}}, 'miami', 'miami01', 'miami02' ;
push @{$hash{florida}}, 'miami', 'miami21', 'miami22' ;
my $name = ${$hash{florida}}[4] . " and " . $hash{florida}[4] ;
print "name = $name \n" ;
How are $hash{florida}[4] and ${$hash{florida}}[4] the same thing?
I would have expected that indirection (I hope that is the correct
word for it) to produce something unintelligible or something
meaningless.
TIA.