Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [EZFrag] Interesting anomaly - Globals

Quote Reply
Re: [EZFrag] Interesting anomaly - Globals In reply to
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:

Code:
sub {
my $get_sub_cats = sub {
# ...
}

my @cats = $get_sub_cats();
}

Adrian
Subject Author Views Date
Thread Interesting anomaly - Globals EZFrag 4406 Feb 5, 2010, 3:40 AM
Thread Re: [EZFrag] Interesting anomaly - Globals
Andy 4307 Feb 5, 2010, 5:09 AM
Thread Re: [Andy] Interesting anomaly - Globals
EZFrag 4254 Feb 15, 2010, 12:20 AM
Post Re: [EZFrag] Interesting anomaly - Globals
Andy 4236 Feb 15, 2010, 12:35 AM
Post Re: [EZFrag] Interesting anomaly - Globals
brewt 4218 Feb 15, 2010, 1:44 AM