Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Question about concatenation

by LanX (Canon)
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


Comment on Re: Question about concatenation
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-11-28 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls