Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: loop iterator in a string

by tybalt89 (Monsignor)
on Sep 27, 2021 at 21:39 UTC ( [id://11137071]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    my $loop="2,4..5";
    splice @$arr,$_,0,999 foreach map { /\.\./ ? $` .. $' : $_ } split /,/
    +, $loop;
    use Data::Dump 'dd'; dd $arr;
    
  2. or download this
    [1, 2, 999, 3, 999, 999, 4 .. 7]
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-29 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found