Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 cooling their heels in the Monastery: (2)
As of 2016-02-08 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (265 votes), past polls