Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Review and Suggestions - My First Module

by narainhere (Monk)
on Dec 10, 2007 at 05:20 UTC ( [id://656056]=note: print w/replies, xml ) Need Help??


in reply to Review and Suggestions - My First Module

Seems like you are hard-coding the user-name and password.why not make that one too as a argument?

The world is so big for any individual to conquer

  • Comment on Re: Review and Suggestions - My First Module

Replies are listed 'Best First'.
Re^2: Review and Suggestions - My First Module
by bradcathey (Prior) on Dec 10, 2007 at 13:50 UTC

    That was something I noticed as well. I usually store my username and password in a .conf file in a another directory and then grab it with some form of Config::Simple. Here's an example I use with CGI::Application::Plugin::Config::Simple (thanks to gmax):

    sub dbconnect { my $self = shift; my %attr = @_; my $user = $self->config_param($attr{'db'}.'.user'); my $pass = $self->config_param($attr{'db'}.'.pass'); my $dbh = DBI->connect_cached('DBI:mysql:'.$dbn.':'.$host, $user, $pass, {RaiseError => 1} ) or die "Can't connect: $DBI::errst +r\n"; return ($dbh); }

    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re^2: Review and Suggestions - My First Module
by awohld (Hermit) on Dec 10, 2007 at 14:53 UTC
    I don't want to have to remember my username and password.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found