in reply to Question of scope

I cannot answer your question regarding @coords without knowing precisely how @coords was previously defined as a global.

Within the use strict; confines, there are two methods which, on the surface appear equivalent, are in fact different.

use vars qw(@coords); our @coords;
I may be able to give a more definite answer if you post more of the code. See also 'our' is not 'my' and Our, use vars, and magic, oh my!

Also, another minor point - the shift; serves no purpose as you have already obtained the arguments from @_.

Replies are listed 'Best First'.
Re: Re: Question of scope
by Popcorn Dave (Abbot) on May 06, 2002 at 20:42 UTC
    My @coords was defined as: my @coords=(); towards the top of my program.

    All I'm attempting to do is push the coordinates on to a global array, but they're being lost after that routine.

    I've done print statements to verfy they did get pushed in to the array, and that $x and $y actually exist ( that I'm not pushing undefined ) so I'm stymied to say the least.

    Hopefully that will clarify my situation so that you may be able to shed a little light on this for me.

    Thanks!

    A reply falls below the community's threshold of quality. You may see it by logging in.