Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Answer: Why does my subroutine not receive the scalar parameter as $_?

( #192723=categorized answer: print w/ replies, xml ) Need Help??

Q&A > subroutines > Why does my subroutine not receive the scalar parameter as $_? contributed by BrowserUk

Use $_[0] (the first element of @_) instead of $_.

See perlman:perlsub Description for explanation.

Comment on Answer: Why does my subroutine not receive the scalar parameter as $_?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-10-20 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (73 votes), past polls