Hi, This is how I do it. #!/usr/bin/perl -wT use strict; my $conf;
unless ($conf = do ('/path/to/config.pl')) { die ("Could not open file"); } print $conf->{'var1'}, "\n"; ----- Then in a file called "config.pl" { var1 => "one", var2 => "two" } ----- The "unless" part is just to check that the file was opened successfully. The "do" actually opens the file and assigns the hash structure to $conf. Hope this helps! Carl > Hi all, > > I want to use: > > use strict; > > And I want to use a configuration file in a Perl script. > The configuration file uses: > %page1=( > .... > ); > > %page2=( > .... > ); > > This way I get errors if I run the script because the variables are not > defined with "my". > > I've tried putting in the configuration file: > > my %page1=( > .... > ); > > But this method doesn't work. > > I use a configuration file and I would like to put the settings only in this > file without modifying the script. > > Is it possible? > > Thanks. > > Teddy, > [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]