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

Re: Question about concatenation

by LanX (Chancellor)
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-09-25 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (463 votes). Check out past polls.