Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Ways to add an item into the middle of an array?

by choroba (Cardinal)
on Nov 20, 2015 at 00:49 UTC ( [id://1148190]=note: print w/replies, xml ) Need Help??


in reply to Ways to add an item into the middle of an array?

See splice:
#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my @line = qw( foo bar baz etc etc etc ); splice @line, 1, 0, ''; # Insert at position 1, replace 0 elements. print Dumper \@line;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Ways to add an item into the middle of an array?
by Cody Fendant (Hermit) on Nov 20, 2015 at 04:02 UTC
    Thank you! I knew there was a function to do that out there...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found