On Wed, Jun 12, 2002 at 02:33:43PM -0700, Scott Chapman wrote: > I have a constant.epl file that defines some variables as part of $req: > > [- > $req = shift; > $req->{website_database} = 'DBI:Sprite:/www/db/Annual_Review'; > $req->{website_event_table} = 'ar_events'; > $req->{website_sequence} = 'ar_num'; > $req->{db_user} = 'username'; > $req->{db_pass} = 'password'; > -] > > I need to get at those definitions in a perl script outside the www > environment and I'm not sure how to do it. Is there a easy way to do this?
As usual, TMTOWTDI. The quick way is to eval it like Tiago suggested. If you need to do this in multiple scripts it might be cleaner to create a module you can just 'use' e.g. package Config; our %const = ( website_database => 'DBI:Sprite:/www/db/Annual_Review', website_event_table => 'ar_events', website_sequence => 'ar_num', db_user => 'username', db_pass => 'password', ); 1; and then in your constant.epl do: [! use Config; !] [- $req = shift; @$req{ keys %Config::const } = values %Config::const; -] Cheers, Gavin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]