ropey has asked for the wisdom of the Perl Monks concerning the following question:

Quick Question

If a module uses the syntax use EVENT::Country qw(:all); However in EVENT::Country, there is no EXPORT_TAGS at all, then the use EVENT::Country qw(:all); is useless right ?

Only reason I ask is that somehow whilst working on a unfamilar system when I enable strict (gulp... this system doesnt have strict on, please don't tell me how bad this is I know - I am just doing some minor modifications to it... its not me promise...) it raises this error

all is not defined in %EVENT::COUNTRY::EXPORT_TAGS

So if its pointless, and would never work anyway then it could be removed ? or am I missing something crucial ?

Replies are listed 'Best First'.
Re: EXPORT_TAGS
by ikegami (Patriarch) on Apr 19, 2005 at 14:24 UTC
    It is useless. As you can see, it gives a run-time error. However, the writter of the script might be expecting the functions of that module to be imported, so go through the script looking if the functions from that module are called. Change instances of xxx() to Event::Country::xxx() or make sure they are imported without using ":all".
      Thanks for quick answer - however if it is useless what would be point of changing instances of xxx() to Event::Country::xxx() as surely it wouldnt have worked in the first place ?

        Your question is moot since something obviously changed (in the module's user or in the module) since it worked, if it ever worked. It might not have been useless then, but right now, it does nothing other than die. That means you either have to change the module, or the code using it. Changing xxx() to EVENT::Country::xxx() is one way of fixing it, but I did mention you may still be able to import the symbols you require. For example, you may be able to import it using use EVENT::Country qw( xxx );, or using a group other than ":all". Refer to your module's documentation or source.

        My apologies if I wasn't clear. I'm a bit fuzzy in the head due to a cold.

Re: EXPORT_TAGS
by revdiablo (Prior) on Apr 19, 2005 at 17:05 UTC
    whilst working on a unfamilar system when I enable strict ... I am just doing some minor modifications to it

    I'm as big a fan of strict as any, but this sounds kind of curious. Enabling strict for some code that didn't have it before is not often compatible with making "minor modifications." I suppose you could be using strict to flush out some specific problems, but it is a risky endevour that might cause you to change code in lots of unrelated places. Hopefully this script has a good test suite, but I have a strange feeling it does not...