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

You need braces:
print "@{$self->{array}}\n";
UPDATE
Just thought I should point out that the @gum in line 1 is not the same @gum from line 9. Which is why you get a blank line after your first one in the correct output. Just FYI.
UPDATE 2
Of courses you can blame XP! But, perhaps you shouldn't in this case.


Who is Kayser Söze?

Replies are listed 'Best First'.
Re: Re: references to arrays. I don't really get it I guess...
by woozy (Novice) on Dec 02, 2003 at 03:02 UTC
    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.)

      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