in reply to Re: Hash reference as a parameter
in thread Hash reference as a parameter
#!/usr/bin/perl use strict; use Data::Dumper; my %input = {foo => 'bar', oof => 'wha'}; my_sub(\%input); $input{foo} = 'bar1'; my_sub(\%input); sub my_sub { my $ref = shift; my %args = ( foo => 'oop', pah => 'meh', oof => 'off', %{$ref} ); warn Dumper(\%args); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hash reference as a parameter
by saberworks (Curate) on Sep 12, 2005 at 21:45 UTC | |
by ramya2005 (Scribe) on Sep 12, 2005 at 22:07 UTC | |
by saberworks (Curate) on Sep 12, 2005 at 22:26 UTC | |
by ramya2005 (Scribe) on Sep 12, 2005 at 23:17 UTC |