gnubbs has asked for the wisdom of the Perl Monks concerning the following question:
A simple question. It has been a long time since I programmed in perl, and for some reason I can't seem to sort this problem out. References in perl....
#!/usr/local/bin/perl -w use strict; sub get_conf(\%); my %cur_conf; $cur_conf{test} = "test"; get_conf(\%cur_conf); print "after: " . $cur_conf{test}; sub get_conf(\%) { my $href = @_; $href->{test} = "another test"; }
To my tired newbie eyes, this looks like it should work but does not. Thanks for any help.
gnubbs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hashes and Functions
by jasonk (Parson) on Apr 10, 2003 at 18:00 UTC | |
by gnubbs (Beadle) on Apr 10, 2003 at 18:51 UTC | |
by kelan (Deacon) on Apr 10, 2003 at 19:20 UTC | |
by hmerrill (Friar) on Apr 10, 2003 at 20:10 UTC | |
by dragonchild (Archbishop) on Apr 14, 2003 at 17:02 UTC | |
|
Re: Hashes and Functions
by bart (Canon) on Apr 11, 2003 at 00:56 UTC |