On Mon, 2009-08-10 at 15:37 -0400, Gorrebeeck, Robert wrote:
> Martin
> 
> What you want to do is use the require function
> 
> require "directory/filename";
> 
> Within your config file
> 
> You would set up the variables like this in your config file
> #VARIABLES (home directory) - make sure you use the keyword 'our'
> our $home_directory="/home/test/customer";
> 
> 
> Then just reference whatever your called your variable in your config
> file
> In your script:
> 
> #reference config file to grab global variables
> require "/home/profile.env";
> 
> #to change to our home directory
> system("cd $home_directory");
> 
> 
> Hope that helps
> 
> Robert Gorrebeeck
> Sr. EDI Developer
> TCM Development Group
> 3220 Keller Springs
> Suite #106
> Carrollton, Texas  75006
> (o) (972) 725-1484
> (e) gorrebeec...@cvty.com
>  
<snip>

Thanks Robert! That is exactly what I was searching for.

It's working I don't have any issues with that :), but I'd like to know
something...can I make it work with "use strict"?

Using your example would say:
Global symbol "$home_directory" requires explicit package name at
test.pl

That appears even if "require" if over "use strict".


Thanks!


Martin


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to