in reply to Re: hash parameter question
in thread hash parameter question
...you have to pass the argument as a hash reference
Untrue:
use Test::More tests => 2; my %nested = ( first => { one => 'two' }, second => { three => 'four' +} ); sub get_element { my ($level_one, $level_two, %nested) = @_; return $nested{ $level_one }{ $level_two }; } is( get_element( 'first', 'one', %nested ), 'two', 'first element +access' ); is( get_element( 'second', 'three', %nested ), 'four', 'second element + access' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: hash parameter question
by tphyahoo (Vicar) on Dec 13, 2005 at 09:33 UTC |