Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: repeat characters in text

by Albannach (Prior)
on May 02, 2007 at 17:46 UTC ( #613224=note: print w/ replies, xml ) Need Help??


in reply to repeat characters in text

You have the right idea, you just need a different operator - print 'a', '!' x 5; will do it. Though Perl doesn't care, I prefer not to use double quotes unless I expect interpolation to be taking place.

--
I'd like to be able to assign to an luser


Comment on Re: repeat characters in text
Download Code
Re^2: repeat characters in text
by blazar (Canon) on May 03, 2007 at 10:43 UTC
    You have the right idea, you just need a different operator - print 'a', '!' x 5; will do it. Though Perl doesn't care, I prefer not to use double quotes unless I expect interpolation to be taking place.
    print "a@{['!' x 5]}"; # :-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-11-26 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (162 votes), past polls