Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re(3): NEWBIE Brain Teaser #2, by nysus

by yakko (Friar)
on Apr 16, 2001 at 06:33 UTC ( #72748=note: print w/replies, xml ) Need Help??


in reply to Re: Re: NEWBIE Brain Teaser #2, by nysus
in thread NEWBIE Brain Teaser #2, by nysus

Because @_ is localised for the subroutine. Since you called subroutine with no parms, the @_ it's operating from has undef.

As for &subroutine, @_ is not localised and the existing one is passed in. $_ need not apply outside the sub in any event -- the subroutine deals with @_.

--
Me spell chucker work grate. Need grandma chicken.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://72748]
help
Chatterbox?
[james28909]: theoretically speaking ofcourse
[james28909]: so if you subtracting as you loop, be aware that you will eventually be subtracting into a past month, or year <.<
[james28909]: dontcha love it!
[james28909]: Today would be scalar localtime. Yesterday would be scalar localtime - 1. sunday - monday would variate scalar localtime - ?
[james28909]: oops s/sunday - monday/sunday - saturday/
[james28909]: my mind is blown haha

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-04-29 03:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.