Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: shift vs @_

by shmem (Chancellor)
on Oct 02, 2006 at 23:15 UTC ( #575973=note: print w/replies, xml ) Need Help??


in reply to Re: shift vs @_
in thread shift vs @_

just to prevent a perception of your statement as dogmatic -
The most important thing though, is to unpack them at the start of the subroutine and to avoid accessing them directly as $_[0], $_[1] etc.

- in most cases, yes. Operating directly on $_[0] is always fine if you know what you are doing, and why, e.g. the sub and the caller are designed that way to avoid costly copying. Whether in such cases a reference should be passed in the first place is another story. But then, $_[0] is a reference already...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575973]
help
Chatterbox?
[marto]: damn
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)
[marto]: in 3 years I may be able to go :P
[Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though
[Corion]: marto: Hehe ;)
[marto]: my out of working hours time is very scarce at the moment
[marto]: unfortunately for you guys I can still access PM during the day :P
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-06-29 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (655 votes). Check out past polls.