in reply to How to create loop in perl dynamically
Also, from perldoc perlop:
Binary ".." is the range operator, which is really two different operators depending on the context. In list context, it returns a list of values counting (up by ones) from the left value to the right value. If the left value is greater than the right value then it returns the empty list. The range operator is useful for writing "foreach (1..10)" loops and for doing slice operations on arrays. In the current implementation, no temporary array is created when the range operator is used as the expression in "foreach" loops, but older versions of Perl might burn a lot of memory when you write something like this:for (1 .. 1_000_000) { # code }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to create loop in perl dynamically
by adithi (Initiate) on Sep 26, 2012 at 14:11 UTC | |
by adithi (Initiate) on Sep 26, 2012 at 14:20 UTC | |
by johngg (Canon) on Sep 26, 2012 at 14:31 UTC | |
by locked_user sundialsvc4 (Abbot) on Sep 26, 2012 at 15:52 UTC |