Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: DBI & CGI Security

by fizbin (Chaplain)
on Jun 04, 2004 at 15:45 UTC ( [id://360951]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI & CGI Security
in thread DBI & CGI Security

One note with that code is that you may want to structure it something like this:
use vars qw[$dbuser $dbpass $dbsecret_time]; my $secretfile = '/path/db.txt'; my $secretfile_modtime = stat($secretfile)[9]; if (!$dbsecret_time or $dbsecret_time < $secretfile_modtime) { open FILE, '<', $file or die $!; chomp(my ($auth) = <FILE>); ($dbuser, $dbpasswd) = split('\t', $auth); close FILE; $dbsecret_time = $secretfile_modtime; }
The reason is that if you ever want to run this code under mod_perl or something similar, you probably won't want to hit the dbpass/secret file more often than necessary.
-- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://360951]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found