Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: NEWBIE Brain Teaser #2, by nysus

by Eureka_sg (Monk)
on Apr 15, 2001 at 21:07 UTC ( #72676=note: print w/ replies, xml ) Need Help??


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

SPOILER ALERT!

From my understanding, the existing @_ will be passed by default when you use &subroutine instead. Is there a change in 5.6?

Edit: chipmunk 2001-04-16


Comment on Re: Re: NEWBIE Brain Teaser #2, by nysus
Re: Re: Re: NEWBIE Brain Teaser #2, by nysus
by merlyn (Sage) on Apr 15, 2001 at 21:08 UTC
SPOILER AHOY!
by MrScrooge (Novice) on Apr 15, 2001 at 23:36 UTC

    You are correct that @_ will be passed to a subroutine if you call it without using the parenthesis. This is true of both 5.6 and 5.005 at least.

    However the result of the attempted assignment of a list to $_ differ depending on Perl version, and this DOES affect the output you will see.

      However the result of the attempted assignment of a list to $_ differ depending on Perl version, and this DOES affect the output you will see.
      Perl never attempts to assign a list to $_. Ever.

      Understanding is demonstrated when correct phrasing is used. {grin}

      -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2015-07-03 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls