Newbee21369
Programmer
This is what I have.
Perl Module:
#!/usr/bin/perl
use lib "/usr/tmhp/data/bin/scripts";
package Test;
use TMH;
use strict;
use DBI;
sub connect_dev_app ()
{
my $dbname = 'DBI:Oracle:TMHT2';
my $user = 'xxx';
my $password = 'xxx';
my $dbh;
$dbh = DBI->connect($dbname,$user,$password,
{
RaiseError => 1,
PrintError => 1,
AutoCommit => 0
});
TMH::writeConsole(*LOGFILE, "Connected to Database successfully\n");
return $dbh;
}
1;
External Script:
#!/usr/bin/perl
use lib "/usr/mypath/scripts";
use TestModule;
TestModule::connect_dev_app();
Perl Module:
#!/usr/bin/perl
use lib "/usr/tmhp/data/bin/scripts";
package Test;
use TMH;
use strict;
use DBI;
sub connect_dev_app ()
{
my $dbname = 'DBI:Oracle:TMHT2';
my $user = 'xxx';
my $password = 'xxx';
my $dbh;
$dbh = DBI->connect($dbname,$user,$password,
{
RaiseError => 1,
PrintError => 1,
AutoCommit => 0
});
TMH::writeConsole(*LOGFILE, "Connected to Database successfully\n");
return $dbh;
}
1;
External Script:
#!/usr/bin/perl
use lib "/usr/mypath/scripts";
use TestModule;
TestModule::connect_dev_app();