Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Filling an array

by robsv (Curate)
on Sep 06, 2001 at 19:57 UTC ( [id://110605]=note: print w/replies, xml ) Need Help??


in reply to Filling an array

Use the x (repetition) operator:
my @arr = (1)x100;
Don't forget the parens around the 1 - if they're not there, you'll end up with an array containing one element: 100 1s concatenated together.

- robsv

Replies are listed 'Best First'.
Re: Re: Filling an array
by zakzebrowski (Curate) on Sep 07, 2001 at 00:15 UTC
    Cool! Didn't know of the x operator....

    ----
    Zak

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-29 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found