in reply to Re: references to arrays. I don't really get it I guess...
in thread references to arrays. I don't really get it I guess...

Okay, but then...

Why does:

print "foo\n"; print "@{$test->{gum}}\n"; if (grep(/^$tag$/), @{$test->{gum}}){ ...
give me:
foo Not an ARRAY reference at line 16 foo noo goo
in particular why does the error for line 16 occur BEFORE the output for line 15? And what is the error of line 16? Something to do with grep?

I'm sorry I'm being dense. (Stupid windows XP. Ah, that was fun.)

Replies are listed 'Best First'.
Re: Re: Re: references to arrays. I don't really get it I guess...
by woozy (Novice) on Dec 02, 2003 at 04:22 UTC
    Aargh. All fixed now. Was another braces problem on another line (the elsif condition) that was only evaluated when the if condition was false. I'm a little confused why the error sometimes appeared before the line above and why the line number was the line number of the if clause and not the line number real culprit, the elsif clause.

    Oh, well. fixed now. Thanks everyone.

      Ordinary print statements are buffered. Error messages are not buffered. Therefore, the relative order of print statements and error message is not predictable.

      --
      TTTATCGGTCGTTATATAGATGTTTGCA