On Fri, 2007-08-24 at 19:32 -0400, Alex Brelsfoard wrote:
> sub main {
> my $catalog_timestamp;
...
> sub get_catalog_timestamp {
...
> $catalog_timestamp = $elt->att('PublishTimestamp');
> "Global symbol "$catalog_timestamp" requires explicit package name"
Yep. You can get away with accessing those lexicals in a function when
your "main" code is at the top level in the script. But when you have
the variable declarations inside one function, the other function can't
see them.
I would do away with main, moving the code out into the top level. If
you *really* have your heart set on your main function (why???), you
could move just the declarations of the "global" variables outside of
it.
-- Jeremy
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm