Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Filling an array

by robsv (Curate)
on Sep 06, 2001 at 19:57 UTC ( #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
Node Status?
node history
Node Type: note [id://110605]
help
Chatterbox?
[Corion]: Whee! Germanys Grand Central Airport (for Berlin, re-scheduled for the thrid or fourth time, to open now in 2018) has just fired their technical lead
[ambrus]: Corion: Is their budget estimate four times the initial estimate yet? Was the construction late by six months already three months after they started?
[marto]: I'll believe it when I see it. That's been due for many years now :P
[marto]: oddly the last time I was there I saw a zeppelin in flight for the first time
[Corion]: ambrus: I don't know how far the budget estimate has been overrun yet
[Corion]: marto: Heh ;) No, you were likely at Tegel or Schönefeld, the new one ("BER") will be somewhat outside of Berlin ;)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-02-23 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (346 votes). Check out past polls.