I've checked cpan AppConfig. I may get back to it.

Thanks Randy



-----Ursprüngliche Nachricht-----
Von: Randy W. Sims [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 15. März 2004 12:36
An: B. Fongo
Cc: [EMAIL PROTECTED]
Betreff: Re: AW: Problem using require()

On 03/15/04 06:19, B. Fongo wrote:
> The idea of creating a package is clear, but it doesn't solve the
> problem at hand. What I want is a possibility for non programmers to
> change the global variable to reflect to their server (e.g. path to
> sendmail, email address, currency symbol etc.) environment without
> messing with the perl codes.
> 
> What I don't understand - is why my scripts get only the first
variable
> in the config file, but fail on the rest.

I would strongly advise against this approach as users could put any 
valid perl code in the 'global.txt' file - a definite security risk. 
Consider using a plain text configuration file and read it manually into

variables or use a module like AppConfig.

As for your example, I was able to use the variables defined in 
'global.txt' with:

#!/usr/bin/perl

use strict;
use warnings;

use vars qw($shop $sendmail $email);

require 'global.txt';


print "<$email>\n";

__END__



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to