good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Dereferenced Arraysby bobf (Monsignor) |
on Aug 19, 2009 at 00:24 UTC ( [id://789641]=note: print w/replies, xml ) | Need Help?? |
Welcome! I suspect that you are confusing arrays and lists. The distinction is a bit subtle (at first) but it is important. Instead of creating 3 arrays and calling poo with each set, you are actually creating one long list and calling the function once. Are you familiar with Data::Dumper (or any of its cousins)? It comes in very handy when trying to understand what is going on with data. Without changing how you call the function, add use Data::Dumper; to the top (right after use strict; use warnings;) and try changing the sub to this: You will easily be able to determine what actually got passed to the sub. I need to emphasize use strict; again. If you had that in your code it would have given you a hint that something was amiss. Hopefully that will give you enough info to complete the exercise. Feel free to ask for further clarification if you can't get it to work.
In Section
Seekers of Perl Wisdom
|
|