Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Adding items to arrays: best approach?

by davido (Cardinal)
on May 28, 2020 at 14:38 UTC ( [id://11117422]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @a = qw(a b c d e);      # Array has 5 elements, with room for 10;
    push(@a, qw(f g h i j)); # Array has ten elements, with room for 10.
    ...
    push(@a, qw(u v w x y)); # Array has 25 elements with room for 30.
    push(@a, qw(z 1 2 3 4)); # Array has 30 elements with room for 30.
    push(@a, qw(5 6 7 8 9)); # Array has to be moved to new memory. Array 
    +has 35 elements with room for 70.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found