tamaguchi has asked for the wisdom of the Perl Monks concerning the following question:
acctually prints: "1 2 3" while..#!usr/bin/perl -w use strict; my (%hash)=('A'=>1, 'B'=>2, 'C'=> 3); rutine(\%hash); sub rutine { my ($hash)=@_; print "$hash{A} $hash{B} $hash{C}\n"; }
..doesn´t. What is the cause of this?#!usr/bin/perl -w use strict; (my ($hash))=rutine(); print "$hash{A} $hash{B} $hash{C}\n"; sub rutine { my (%hash)=('A'=>1, 'B'=>2, 'C'=> 3); return(\%hash); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Reference curiosity?
by borisz (Canon) on Apr 23, 2006 at 17:31 UTC | |
Re: Reference curiosity?
by kvale (Monsignor) on Apr 23, 2006 at 17:32 UTC | |
Re: Reference curiosity?
by GrandFather (Saint) on Apr 23, 2006 at 18:34 UTC | |
Re: Reference curiosity?
by NetWallah (Canon) on Apr 23, 2006 at 17:59 UTC | |
by Anonymous Monk on Apr 23, 2006 at 19:07 UTC | |
Re: Reference curiosity?
by chanio (Priest) on Apr 23, 2006 at 19:52 UTC |