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

Re: loop iterator in a string

by LanX (Saint)
on Sep 28, 2021 at 15:45 UTC ( [id://11137091]=note: print w/replies, xml ) Need Help??


in reply to loop iterator in a string

> I would like to use the ".." as a loop operator but in a string.

Does it really need to be a string?

What about a functional solution to store intervals?

DB<83> $loop = sub {2,4..5} DB<84> say for &$loop 2 4 5 DB<85>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137091]
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-24 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found