According to documentation: "The right operand is not evaluated while the operator is in the "false" state, and the left operand is not evaluated while the operator is in the "true" state." So I would expect that the result of this code would be "caqw". I am assuming here that Perl processes each array element char by char "from left to right" and therefore doesn't evaluate /c/ operand, because it's in false state, and then goes to true state because it evaluates /a/ operand and stays so till the end.perl -we'my @l = qw/ca qw/; for (@l) { print if /a/../c/ }'
|
Comment on
Scalar range operator again
Download Code | |
|---|---|
| Re: Scalar range operator again by choroba (Prior) on Jul 06, 2012 at 12:04 UTC | |
| Re: Scalar range operator again by dsheroh (Parson) on Jul 06, 2012 at 12:13 UTC | |
| Re: Scalar range operator again by Anonymous Monk on Jul 06, 2012 at 12:37 UTC | |
by kejv2 (Novice) on Jul 06, 2012 at 18:33 UTC | |
by dsheroh (Parson) on Jul 07, 2012 at 08:08 UTC | |
by kejv2 (Novice) on Jul 07, 2012 at 10:33 UTC | |
by Anonymous Monk on Dec 15, 2012 at 07:58 UTC | |
| Re: Scalar range operator again by sundialsvc4 (Monsignor) on Jul 06, 2012 at 16:36 UTC |