User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 456,509 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,657 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 1017 | Replies: 2
Reply
Join Date: Sep 2007
Posts: 1
Reputation: sunil_kumar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sunil_kumar sunil_kumar is offline Offline
Newbie Poster

Correct my code plz

  #1  
Sep 29th, 2007
#!/usr/local/bin/perl
#check_oracle#

use strict;

use DBI;
use Net:MTP;

$ENV{'ORACLE_HOME'} = '/app/oracle/product/9.2';

my $errors;
my $total = 0;

check_oracle();

if($total > 0) {
my $mailer = Net:MTP->new("142.1.0.1");
$mailer->mail('dpr-prod@repl1.newport.net');
$mailer->to('root');

$mailer->data();
$mailer->datasend("Subject: DPR database");
$mailer->datasend("\n");
$mailer->datasend($errors);
$mailer->dataend();
}

sub check_oracle {
my $username = '######_@@@@';
my $password = '@@@@';
my $tnsalias = 'DPR';

my $dbh = DBI->connect('dbi:Oracle:'.$tnsalias, $username, $password, { PrintError => 0 });
unless($dbh) {
$errors .= "DPR database may be unavailable.\n";
$total++;
};
}
Last edited by sunil_kumar : Sep 29th, 2007 at 3:36 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Posts: 8
Reputation: [-!dEmOn!-] is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
[-!dEmOn!-]'s Avatar
[-!dEmOn!-] [-!dEmOn!-] is offline Offline
Newbie Poster

Re: Correct my code plz

  #2  
Oct 21st, 2007
Whats wrong with it?

What errors did it return?
Attention!! - IT Professionals[][][]
dEmOn1337 Needs IT Professionals for Online Community!
http://demon1337/forum/ --> Computer/Internet Security and Development Forum
You are chosen! XD
Reply With Quote  
Join Date: Mar 2006
Posts: 642
Reputation: KevinADC is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 36
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Master Poster

Re: Correct my code plz

  #3  
Oct 21st, 2007
anyways, why should anyone just correct your code for you even if there is a problem? This is not a code debugging/ script writing service, it's a help forum.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Perl Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Perl Forum

All times are GMT -4. The time now is 3:48 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC