Batchrun Team > Batch-Batchrun > Batch::Batchrun::Pwlookup



Annotate this POD


New  2
Open  0
View/Report Bugs
Module Version: 1.03   Source  


Pwlookup - Batchrun extension to lookup passwords


  use Batch::Batchrun::Pwlookup qw(dbpwdlookup);
  $dbpassword = dbpwdlookup($database_server,$database_user);


Pwlookup is an important part of the Batchrun application. This module allows passwords to be looked up from an encrypted file and passed to database functions requiring authentication. To successfully run in a batch environment it is often necessary to store a password somewhere. By storing it in an encrypted file that can only be unencrypted by the user, security can be much better than if hardcoded in the program. It also allows a program to move from development to testing to production without having to edit the code.

Pwlookup does not do encryption itself. Pwlookup is designed to read a pipe that contains database names, user names, and passwords. It is up to the user to provide whatever type of encryption they wish (if any).

Pwlookup runs the program specified by the environment variable BR_ENCRYPT or the br.config configuration variable BREncrypt and reads its output. The output must be one or more lines in the following format.

databasename:username:password:some comment: databasename2:username2:password2::

(The comment field is not currently being used but all the colons are important!)

The command being run does allow $ENV{} variables to be replaced in the string before the command is executed thus allowing a user or application specific file. Simple examples are contained in the br.config file.


Daryl Anderson <>



syntax highlighting: