Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Array comparison doesn't work

by choroba (Abbot)
on Nov 23, 2013 at 18:57 UTC ( #1064069=note: print w/ replies, xml ) Need Help??


in reply to Array comparison doesn't work

You cannot unflatten two arrays from the parameter array. If you want to pass two arrays to a subroutine, use a reference:

arrayComp(\@a, \@b); sub arrayComp { my ($aref, $bref) = @_; my @a = @$aref; my @b = @$bref;

Moreover, what do you think using (@a, @b) in the parameter list does?

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Array comparison doesn't work
Select or Download Code
Re^2: Array comparison doesn't work
by vihar (Acolyte) on Nov 23, 2013 at 20:23 UTC
    Thanks for your help! I was just passing in array like I was passing in variables. I didn't think there would be much difference but thanks for pointing it out.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-10-22 00:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls