in reply to Passing multiple hashes?

Perl passes everything to your subroutine in the @_ array, so it can't tell where one hash ends and the other begins. Everything will end up in your first hash, as you've found.

TIMTOWTDI, but probably the easiest is to pass references instead:

sub register { my ($eref, $fref) = @_; my %error = %$eref; my %FORM = %$fref; # ... } # # Call it like so: # register(\%error, \%FORM);

HTH

Replies are listed 'Best First'.
Re: Re: Passing multiple hashes?
by Monolith-0 (Beadle) on Dec 12, 2001 at 08:07 UTC

    Thanks, that's just what I needed. Unfortunatly, when I try it exactly that way, I occationally get the error:

    Can't use an undefined value as a HASH reference at A_user.pm line 54.
    Where line 54 is:
    my %error = %$eref;
    I managed to avoid this by just using the refs directly:
    $$error_ref{'any'};

    - Monolith