Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Period vs. Comma concatenation and reference material for it

by count0 (Friar)
on Jan 23, 2002 at 20:22 UTC ( #140922=note: print w/replies, xml ) Need Help??


in reply to Period vs. Comma concatenation and reference material for it

I think it's important to note here that a comma *does not* concatenate.
print() accepts a list, which is what you were giving it.
It is my assumption that the '.' forces the variable to be printed in a scalar context instead of as a list.
Bingo =)
The dot operator concatinates two strings
A string is a scalar. You tried to concat a string ("\n") with a list, which is not possible. So Perl took the liberty of putting @array in its scalar context.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://140922]
help
Chatterbox?
[erix]: So it's this Babis character that has won?
[erix]: that doesn't sound good...
[choroba]: We'll see how the coalition negotiations go, but I'm sceptical

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2017-10-21 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (270 votes). Check out past polls.

    Notices?