in reply to Re^3: Perl bug ?
in thread Perl bug ?

Why I have
[[[ARRAY(0x137cd48)]]] [[[some text 1 ]]]
then ? First argument should be true only if $errors->[0] contains string /Journal file not found/ no ?

Replies are listed 'Best First'.
Re^5: Perl bug ?
by tinita (Parson) on Feb 06, 2013 at 12:48 UTC
    like I said. the first argument passed to ok() is $errors && ($errors->[0] =~ /.../i). what gets really passed is $errors. it's like saying: my @foo = $errors && ($errors->[0] =~ /.../i)
    the pattern match isn't executed at all at the first time. but after processing the first argument, you use $errors->[0] in your second argument. now $errors is autovivified to an array ref before ok() is actyally executed. since $errors is passed as the first argument as an alias, it prints ARRAY(0x137cd48)
      what gets really passed is $errors
      Why? I would expect the result of the && operation to be passed.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        I would expect the result of the && operation to be passed.
        yes, and the result of something_false && something is something_false. the second part is never processed.