sub {} type globals get loaded by using eval() on them. Your snippet of code isn't something you should do, as it puts that function you defined into into (I'm guessing) GT::Config's namespace. Whichever one that gets called last will redefine that subroutine.
Instead, you should be using a code reference:
my $get_sub_cats = sub {
# ...
}
my @cats = $get_sub_cats();
}
Adrian
Instead, you should be using a code reference:
Code:
sub { my $get_sub_cats = sub {
# ...
}
my @cats = $get_sub_cats();
}
Adrian