![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Formats and Variable Scopeby jreades (Friar) |
on Nov 19, 2002 at 12:07 UTC ( #214088=note: print w/replies, xml ) | Need Help?? |
I may be misreading the code, but it looks like you're trying to access the formats as if they were variables declared in your imported package, when they're actually being defined within a sub. You have two choices, depending on how you want to define your formats:
I'd probably go with '1' since there's nothing really happening that seems to require a sub.
I haven't tried compiling this and it's been a long time since I've worked with formats, so you might need to do some tweaks (I notice that in your code the last two lines use double-quotes to make the assignment, for instance), but this gives you a fairly flexible structure... have more Admin reports? Define a new package Formatting::Admin::Other::top. Want to have user reports? Formatting::User::Usage::top. And so on. HTH
In Section
Seekers of Perl Wisdom
|
|