in reply to passing hashes and hash reference
When you say
then %hash is passed to myroutine() as a list. This means that inmyroutine(%hash);
will print, randomly, either 'alpha', 'beta', or 'gamma'. (In practice, it'll print 'gamma', but in principle the order is undetermined.)%hash = ( 'alpha' => 'alpher', 'beta' => 'bethe', 'gamma' => 'gamow'); myroutine(%hash); sub myroutine { print shift, "\n"; }
stephen
|
|---|