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

i need to know if there is some way to have a file that looks something like this:
$array[0]="value"; $array[1]="value";
then i want to open the file and use the code in it directly as perl. thanks, steve

Replies are listed 'Best First'.
Re: perl db file
by chromatic (Archbishop) on Mar 23, 2000 at 01:42 UTC
    Data::Dumper does something like this -- it spits out Perl data structures into valid Perl syntax. Also look at use and require.
Re: perl db file
by Anonymous Monk on Feb 18, 2000 at 01:31 UTC
    you should be able to write it to a flat file, add a 1; at the end of it and then say require "filename"; at the top of your script. The 1; is needed so that require will return a true value.
Re: perl db file
by Anonymous Monk on Feb 18, 2000 at 15:34 UTC
    require "filename"; 1;