in reply to Hashes and Functions
But a second problem is that prototypes change the way you have to call your sub. With a prototype \%, perl wants you to pass in a hash, and it will pass on a reference to it to the sub. So the call should look like:
With that additional change, your code runs as expected, on my system (perl 5.6.1).get_conf(%cur_conf);
Similar, with a prototype \@, you must pass in an array, not an array reference:
Resulting in: 1 2 3 4sub mypush (\@@) { my $aref = shift; push @$aref, @_; } @a = (1); mypush @a, 2, 3, 4; print "@a\n";
|
|---|