Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Recieving lists as arguments

by lhoward (Vicar)
on Jul 12, 2001 at 20:46 UTC ( #96107=note: print w/replies, xml ) Need Help??


in reply to Recieving lists as arguments

When you call a subroutine, all the arguments passed to it are in the special perl vaiable @_. When you call:
@pictures = shift(); # broken
@_ is shifts implied argument (since you didn't supply an argument to shift explicitly). Shift removes and returns the first element of an array. To get the code to work the way you want it to, replace with:
@pictures = @_;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2019-08-21 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?