in reply to Re: "do" what?
in thread "do" what?

Or if you don't want to go that far, you can change it to something like:
{ username => 'zxcvb', password => 'zzzzz', }
and use it like this: my $config = do "config.pl";

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: "do" what?
by grantm (Parson) on Oct 21, 2002 at 23:21 UTC

    From a security perspective, that's just as bad. Someone with write access to the config file could change it to:

    system("insert malicious command here"); { username => 'zxcvb', password => 'zzzzz', }

    If you don't need to trust the keeper of the config file to refrain from malicious or even dumb stuff, why expose yourself to the risk.

    Check out YAML for another way to represent complex data structures in config files without needing eval (or "do" in this case).

      If that's an issue, use Safe;

      Makeshifts last the longest.