Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Question about concatenation

by LanX (Bishop)
on Dec 23, 2012 at 20:21 UTC ( #1010118=note: print w/replies, xml ) Need Help??


in reply to Question about concatenation

the dot . is a scalar operator expecting something convertible to a string.

from perlop: Binary "." concatenates two strings.

print operates on lists and the comma is the necessary list operator to delimit the elements.

try

print "Counting up: " . join ( "", 1..6 ) . "\n";

or

@arr=1..6; print "Counting up: @arr\n";

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010118]
help
Chatterbox?
and all is quiet...

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

















    Results (269 votes). Check out past polls.

    Notices?