Hi all,

Thanks for all you input. I'm mulling it all over to decide what works best for me. That's the beauty of it all - there's always more than one way to get what you want. Thanks again.

Mark


On Feb 18, 2005, at 11:37 AM, Rich Morin wrote:

At 8:39 AM -0800 2/18/05, Mark Wheeler wrote:
Is it possible to have a bunch of variables in a separate file
and then require that file in the script file?

Possible, yes. Advisable, no. I tend to use YAML (www.yaml.org) for this sort of thing, as:

  # some_data.yml

  List:
    -  1
    -  2
    -  3
    -  4
    -  5

Then, after loading the file, I access the data as:

  foreach $item (@{ $r->{List} }) {
    print $item;
  }

YAML is easy to read and edit, maps well to Perl data structures,
is language-independent, loads safely, etc.

-r
--
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series



Reply via email to