Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: new to perl, syntax question

by tangent (Deacon)
on Feb 20, 2012 at 13:50 UTC ( #955072=note: print w/ replies, xml ) Need Help??


in reply to Re^2: new to perl, syntax question
in thread new to perl, syntax question

Aagh - I did try it before I replied but like this:

print @name . "\n";
then I took the "\n" out to make it clearer (but didn't run it!). I take it the concatenation makes print evaluate in scalar context. So should be:
print "@name"; # prints x y z print @name; # prints xyz print @name . "\n"; # prints 3
(lidden: I was still fixing this when you replied)

Update - then I found this:
If you believe in Lists in Scalar Context, Clap your Hands
I'll be back in a few weeks.


Comment on Re^3: new to perl, syntax question
Select or Download Code
Re^4: new to perl, syntax question
by lidden (Deacon) on Feb 20, 2012 at 13:56 UTC
    Concatenation puts its arguments in scalar context, that is the array is in scalar context.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-07-24 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls