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

Re^3: Generate list with array elements repeated x times

by toolic (Bishop)
on Oct 16, 2014 at 20:59 UTC ( [id://1104113]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Generate list with array elements repeated x times
in thread Generate list with array elements repeated x times

You're welcome. I was wondering if there was a way to get rid of your pop/shift, and it turns out you could use splice instead. You determine if this is too clever or not:
return map { ($_) x 10 } splice @dates, 1, -1;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-19 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found