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

The "Not an ARRAY ref" error is due to precendence rules. Consider:
print "@{$self->{array}}"; vs print "@$self->{array}";
That said - there are a number of other problems with your code that will show up once you "use strict;".

Michael

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 02:35 UTC
    Thanks. The braces makes a lot of sense. The thing was in my real code I still got errors when I used braces. But this was actually from another iteration where $self was a different thing altogether but the error looked the same so I assumed it was. Uh, what sort of "number of other problems". Might as well find out about them now rather than later.
      Uh, what sort of "number of other problems". Might as well find out about them now rather than later.
      Why don't you "use strict;" and find out?
      The first problem is your @gum array. You initialize it in package "main", but you reference it in package "test". Which means that you are accessing two different @gum arrays: @main::gum and @test::gum. Using "strict" would point that out (among other things).

      Michael