Hossein has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I know that only one @array can be sent to a function as param, otherwise \@array1, \@array2, ...

Now I have one scalar, one array and one hash. It seems like recieved parameters has wrong content!

what's the most secure way of doing it?

/Hossein

Replies are listed 'Best First'.
Re: $S, @A, %H parameter in function call
by choroba (Cardinal) on Aug 29, 2013 at 11:36 UTC
    The arrays and hashes behave the same with respect to being parameters of subroutines. Use references for both:
    sub func { my ($scalar, $array_ref, $hash_ref) = @_; } func($scalar, \@array, \%hash);
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ