On Thu, Jul 26, 2001 at 05:27:28PM -0700, Paul wrote:
>  sub pushHash (\%@) { # somebody please check that prototyping

>      local *INHASH = shift;

This is clever, but should probably be avoided (mostly because it's clever).


>      my %tmpHash  = ( @_ ); 
>      @INHASH{keys %tmpHash} = values %tmpHash;
>  }

It'd probably be better to use one of the iterative examples, if you're
going to be sticking it in a function.  They scale better with regard to
memory as @_ gets bigger.


>    pushHash(\%target, @listToAdd);

This call would raise a fatal exception.  The first argument must be a hash,
not a hash reference.


> or even (I *think*):
> 
>    pushHash %target, -x => 24, -y => 25, -z => 26;

This is the call you'd have to use.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to