Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: For Review: DB Import

by mandog (Curate)
on Jan 25, 2002 at 08:54 UTC ( [id://141426]=note: print w/replies, xml ) Need Help??


in reply to For Review: DB Import

Some very, very minor points.

You might put the definition of  $username, $password, $dsn at the very top of the script. This will make it easier to make simple modifications quickly. Something like:

use strict; use DBI; use Getopt::Std; my $dsn = "DBI:mysql:$database:localhost"; my $username = 'username'; my $passwd = unpack("u", $enc_passwd); ######### No User servicable parts below ############
Also, I'm not sure what the gain is with the obscured password. It isn't too hard to say:
print unpack("u", $enc_passwd);


email: mandog

Replies are listed 'Best First'.
Re: Re: For Review: DB Import
by impossiblerobot (Deacon) on Jan 25, 2002 at 22:02 UTC
    Thanks, mandog. I originally put my config variables at the top of my script. I added my usage statement at the top to give a POD-like overview to anyone reading the code (which of course begs the question of why I didn't use POD itself). I agree that this tends to bury the config vars pretty deep, and I like the suggestion someone else made about using constants to correct it.

    The obscured password is my equivalent of the asterisks that appear when you are typing in a password field. (Sure, someone can pay close attention to what I'm typing, but it prevents people subconsciously picking it up while standing over my shoulder.) No one who should not have access to the password should have access to the script itself.

    Impossible Robot

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found