in reply to Iterate string like, for(1..5) i.e. $stirng="1..5"; for($string)

Note that for($x..$y) is optimized to be lazy but that isn't true for for(eval"$x..$y"). For example:

$ perl $x=1<<30; for(1..$x){last;} warn "first"; for(eval "1..$x"){last;} warn "second"; __END__ first at - line 3. core dumped

The for(1..$x) very quickly tries $_=1 and then exits the loop. The for(eval "1..$x") doesn't even run because it tries to build the entire "1..1<<30" list in memory before it can get started and it runs out of memory and dumps core before then.

Just something to keep in mind.

- tye