Andrew Gaffney wrote:
Wiggins d Anconia wrote:
Wiggins d Anconia wrote:
my %masks;
my %use;
my @pkglist;
my %pkgdeps;
Why are these declared with a global scope? If they must be then
something is wrong with your subs. Move these to after your sub
listing, if your program still works then th
Wiggins d Anconia wrote:
Wiggins d Anconia wrote:
my %masks;
my %use;
my @pkglist;
my %pkgdeps;
Why are these declared with a global scope? If they must be then
something is wrong with your subs. Move these to after your sub
listing, if your program still works then they are fine as globals,
ot
> Wiggins d Anconia wrote:
> >>
> >>my %masks;
> >>my %use;
> >>my @pkglist;
> >>my %pkgdeps;
> >
> > Why are these declared with a global scope? If they must be then
> > something is wrong with your subs. Move these to after your sub
> > listing, if your program still works then they are fine
Wiggins d Anconia wrote:
Charles K. Clarkson wrote:
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
:
: I think that 'my' is bad because I have something similar to:
:
: my %tree;
:
: sub return_an_arrayref() {
:my @array = ('thing1', 'thing2', 'thing3');
:return [EMAIL PROTECTED];
: }
:
: s
[snip]
>
> It was more pseudocode than anything. I can't seem to duplicate the
problem with
> test code. One thing I forgot to mention is that these functions are
called
> recursively as far as 15 levels deep. Would that cause issues when
returning a
> ref to a 'my'ed array from a function?
>
> Charles K. Clarkson wrote:
> > Andrew Gaffney <[EMAIL PROTECTED]> wrote:
> > :
> > : I think that 'my' is bad because I have something similar to:
> > :
> > : my %tree;
> > :
> > : sub return_an_arrayref() {
> > :my @array = ('thing1', 'thing2', 'thing3');
> > :return [EMAIL PROTECTED]
Wiggins d Anconia wrote:
Wiggins d Anconia wrote:
I have a number of functions in a program I'm writing that return a
reference to
an array or hash. In the functions, I declare the variable to return
with 'my'
which I'm finding out is bad. Should I declare variables to return
from a
functi
Charles K. Clarkson wrote:
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
:
: I think that 'my' is bad because I have something similar to:
:
: my %tree;
:
: sub return_an_arrayref() {
:my @array = ('thing1', 'thing2', 'thing3');
:return [EMAIL PROTECTED];
: }
:
: sub build_tree() {
:for
Andrew Gaffney <[EMAIL PROTECTED]> wrote:
:
: I think that 'my' is bad because I have something similar to:
:
: my %tree;
:
: sub return_an_arrayref() {
:my @array = ('thing1', 'thing2', 'thing3');
:return [EMAIL PROTECTED];
: }
:
: sub build_tree() {
:foreach(@thing) {
: $tree
> Wiggins d Anconia wrote:
> >>I have a number of functions in a program I'm writing that return a
> >
> > reference to
> >
> >>an array or hash. In the functions, I declare the variable to return
> >
> > with 'my'
> >
> >>which I'm finding out is bad. Should I declare variables to return
fro
Wiggins d Anconia wrote:
I have a number of functions in a program I'm writing that return a
reference to
an array or hash. In the functions, I declare the variable to return
with 'my'
which I'm finding out is bad. Should I declare variables to return from a
function with 'our'? Do I need to m
> I have a number of functions in a program I'm writing that return a
reference to
> an array or hash. In the functions, I declare the variable to return
with 'my'
> which I'm finding out is bad. Should I declare variables to return from a
> function with 'our'? Do I need to make sure I don't ha
12 matches
Mail list logo