in reply to Re: Is "ref $date eq 'ARRAY'" wrong?
in thread Is "ref $date eq 'ARRAY'" wrong?

You couldn't possibly mean push @ary => $_! I mean, I understand using the fat arrow in some cases but you've got it pointing the wrong way. Since the arrow goes the wrong way, why aren't you using a plain comma?

Replies are listed 'Best First'.
Re: Re: Re: Is "ref $date eq 'ARRAY'" wrong?
by Ovid (Cardinal) on Dec 19, 2003 at 22:26 UTC

    I can't make a serious justification, other than to visually group parts of an expression.

    push @array => $foo, $bar, $baz; join '|' => $foo, $bar, $baz; map func($_) => $foo, $bar, $baz;

    In this case, while the arrow appears reversed, I do it for stylistic consistency with the other expressions.

    Cheers,
    Ovid

    New address of my CGI Course.

      Hm, ok. That's an interesting idea anyway.
Re: Re: Re: Is "ref $date eq 'ARRAY'" wrong?
by duff (Parson) on Dec 20, 2003 at 06:54 UTC
    You couldn't possibly mean push @ary => $_!

    No, he actually meant push @ary, @$foo; rather than looping at all ;-)

      Yes, you're absolutely correct. I got wrapped up inthe details of the problem and didn't focus on the actual code. Whoops :)

      On another note, I swear I answered this a couple of days ago, but I see in glancing at the post that I apparently didn't. Grr ...

      Cheers,
      Ovid

      New address of my CGI Course.