Re: basic use of modules

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Quoted text here. Click to load it

BM> The second. However, you may find it more awkward if you really want a
BM> big list of variables to import. A better option would be to put these
BM> constants into a single hash, instead, and then import that; a third
BM> would be to use the 'constant' module to define proper named constants.

The OP could put all that data in a file (YAML, XML, CSV, etc).  It
would be faster on load too, if the list is big.  I can't tell the OP
what format to use since I don't know how the header name and the column
name are defined, but probably even something as simple as

1 name
2 address
3 zip code

in a plain text file would work, to be processed with

split " ", $line, 2;

I've said it before and I'll say it again, storing pure data in code is
a bad idea, especially if the data structure is simple.


Site Timeline