Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How do I insert an element into an arbitrary (in range) array index?

by Russ (Deacon)
on Sep 04, 2000 at 00:52 UTC ( [id://30946]=note: print w/replies, xml ) Need Help??


in reply to How do I insert an element into an arbitrary (in range) array index?

Use splice with 0 for the length argument.
my @R = (1,2,3,4,5,6,7,8,9); splice @R, 1, 0, 'Test'; print "@R\n";
prints: 1 Test 2 3 4 5 6 7 8 9
  • Comment on Re: How do I insert an element into an arbitrary (in range) array index?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2025-06-22 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.