Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re (tilly) 1: difference between ($scalar) and $scalar

by tilly (Archbishop)
on Jul 21, 2001 at 10:58 UTC ( #98637=note: print w/replies, xml ) Need Help??


in reply to difference between ($scalar) and $scalar

Without the parentheses, you are defining a scalar. With them you define a list of one thing. The difference is that the RHS is evaluated in a different context, as can be verified by putting a function there and testing wantarray.

Look at Arrays are not lists for more on this topic.

  • Comment on Re (tilly) 1: difference between ($scalar) and $scalar

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-10-23 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (87 votes). Check out past polls.

    Notices?