P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Dear Monks,
I would like to use the ".." as a loop operator but in a string. Is there any simple perl-ish way I can accomplish this? For some reason, I thought perl would support this, but it doesn't.
I want $arr to be [1, 2, 999, 3, 999, 999, 4, 5, 6, 7]. This works fine if you pass in 2,4..5 instead of "2,4..5". I notice that '2', '4'..'5' will also work, but when the .. operator is within string, it does not. Thank you for your time!Michael In reply to loop iterator in a string by Anonymous Monk
|
|