Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2024-04-24 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found