Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Parameters, subs and the shift function

by monktim (Friar)
on Aug 19, 2003 at 14:42 UTC ( [id://284913]=note: print w/replies, xml ) Need Help??


in reply to Re: Parameters, subs and the shift function
in thread Parameters, subs and the shift function

Abagail-II, what is the signifigance of the + in the shift statements? Why is this a good thing to do?
my @array1 = @{+shift}; my @array2 = @{+shift};
Thanks,
Tim

Replies are listed 'Best First'.
Re: Parameters, subs and the shift function
by Abigail-II (Bishop) on Aug 19, 2003 at 14:55 UTC
    Run it under strict, and try it without the +. The error message you get will enlighten you.

    Abigail

      Ahh, thank you. I'm a little embarrassed. I never dereferenced a builtin like shift only user defined functions.
      Global symbol "@shift" requires explicit package name at noname5.pl li +ne 5. Global symbol "@shift" requires explicit package name at noname5.pl li +ne 6. Execution of noname5.pl aborted due to compilation errors.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-19 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found