kejv2 has asked for the wisdom of the Perl Monks concerning the following question:
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/ }'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Scalar range operator again
by dsheroh (Monsignor) on Jul 06, 2012 at 12:13 UTC | |
|
Re: Scalar range operator again
by choroba (Cardinal) on Jul 06, 2012 at 12:04 UTC | |
|
Re: Scalar range operator again
by Anonymous Monk on Jul 06, 2012 at 12:37 UTC | |
by kejv2 (Acolyte) on Jul 06, 2012 at 18:33 UTC | |
by dsheroh (Monsignor) on Jul 07, 2012 at 08:08 UTC | |
by kejv2 (Acolyte) 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 locked_user sundialsvc4 (Abbot) on Jul 06, 2012 at 16:36 UTC |