in reply to Re: Hiding passwords in scripts
in thread Hiding passwords in scripts

I am having a similar problem, but my problem is that my software has these lines repeated multiple times, so can you please elaborate on this topic?

I'm looking to create a configuration file with the appropriate information, and get it into my source. What directive would I need to include: use? require?

amt.

perlcheat

Replies are listed 'Best First'.
Re^3: Hiding passwords in scripts
by pelagic (Priest) on Sep 29, 2004 at 13:29 UTC
    You could use a very simple config file (call it eg .secret.config to make it hidden) such as:
    first secret second public
    and parse it with ConfigReader::Simple like:
    use strict; use ConfigReader::Simple; my $config = ConfigReader::Simple->new(".secret.config"); print $config->get( "first" ), "\n"; print $config->get( "second" ), "\n";
    Update
    Of course hidden is not read protected. It's just that you don't see your settings in the code. To get more security you might want to protect the config file with a mode that only the executor can read the content ... but then how can the developers test the thing?

    pelagic
Re^3: Hiding passwords in scripts
by ikegami (Patriarch) on Sep 29, 2004 at 14:52 UTC
    No, use, require and eval should not be used. do is the one. Search for threads on including other perl files for discussions on this topic.