in reply to Re^2: Perl bug ?
in thread Perl bug ?
the first call of ok():
the first argument is $errors && ($errors->[0] =~ /.../i) which results in $errors being passed as the first argument. before it is passed, array element 0 gets autovivivied though by usage in the second argument.
the second call:
$errors is now true, so the matching is executed and its result would the empty string ("false"). but since the matching is executed in list context, the result is an empty list, so what you wrote as a second argument becomes now the first argument.
the first argument is $errors && ($errors->[0] =~ /.../i) which results in $errors being passed as the first argument. before it is passed, array element 0 gets autovivivied though by usage in the second argument.
the second call:
$errors is now true, so the matching is executed and its result would the empty string ("false"). but since the matching is executed in list context, the result is an empty list, so what you wrote as a second argument becomes now the first argument.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl bug ?
by vsespb (Chaplain) on Feb 06, 2013 at 12:36 UTC | |
by tinita (Parson) on Feb 06, 2013 at 12:48 UTC | |
by choroba (Cardinal) on Feb 06, 2013 at 12:55 UTC | |
by tinita (Parson) on Feb 06, 2013 at 13:25 UTC | |
by choroba (Cardinal) on Feb 06, 2013 at 13:32 UTC | |
| |
by vsespb (Chaplain) on Feb 06, 2013 at 14:58 UTC |
In Section
Seekers of Perl Wisdom