in reply to Two Range Operator Anomalies
For the first question, read further. "The range operator (in list context) makes use of the magical auto-increment algorithm if the operands are strings."
For the second question, you got bitten by the side-effect of an optimisation. Constant ranges are expanded into a list at compile-time. You modified this list, affecting future use of it. Workaround:
for ('a'..'f') { my $letter = $_; # Make modifiable copy ... }
Update: Misunderstood the first question
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Two Range Operator Anomalies
by liverpole (Monsignor) on Mar 11, 2009 at 16:25 UTC | |
by ikegami (Patriarch) on Mar 11, 2009 at 16:32 UTC |