in reply to Variable Package Names?

The "package" is determined strictly at compile time. First, I'll rant about wanting to mix code and data, a great source of security holes if not also a horrible maintainance headache (what if they ask for "main" as the package to import their variables!?). Having said that, one option is to do as the Exporter does with the import routine, messing with globs to copy values. Ewww. Much smoke, many mirrors.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE:(2) Variable Package Names?
by swiftone (Curate) on Aug 14, 2000 at 21:05 UTC
    First, I'll rant about wanting to mix code and data

    Well, I'm not really trying to mix data, so much as providing the programmer with options. The Package name is variable purely so that the programmer can create multiple copies of the same dataset. It should never be selected from using data, same as one shouldn't have "soft" references from data either.

    what if they ask for "main" as the package to import their variables!?

    I would hope it would create a bunch of variables in main. Yes, this would trample any existing variables of the same name, but that's why the programmer should know what names the script is being called on :)

    Having said that, one option is to do as the Exporter does with the import routine, messing with globs to copy values.

    I was afraid that might be the answer. Thanks.