Hello,
I'm looking for a Perl example passing parameters.
The code below has the userids and passwords hardcoded in clear text in the system line, parms 3 and 5 (five lines from the bottom), and the Oracle sid is hardcoded also. The code has to be changed to 1) read .pwd1 and .pwd2 files containing the passwords, and set a literal for the SID and substitute it at in the code.
I'm not a Perl coder, and would appreciate any information, hints, or links to the manual.
Thanks, Linda
#!/usr/local/bin/perl
#
use CGI qw(:standard);
#
$| = 1;
($sec,$min,$hour,$mday,$mmonth,$myear,$wday,$yday,$isdst) = localtime(time);
if ($myear < 99) {
$myear++;
}
$myear += 1900;
$mmonth += 1;
print header;
if (!param()) {
print start_html('dev02 QRX4 DB Refresh'),
h1('<center>dev02 QRX4 DB Refresh for Formulary qRx Version 4.0'),
hr,
"<body bgcolor=\"#ffff66\" text=\"#000000\"><br>",
"Enter a date to start the Oracle database refresh script,<br>",
"then hit <i>Submit</i> to kick off the refresh for that date.<p>",
start_form,
"Enter the target refresh date: ",
textfield('day',$mday,2),
textfield('month',$mmonth,2),
textfield('year',$myear,4),
p, submit('Submit'),
end_form,
hr;
} else {
# print "You entered :<p>";
$dy = param('day');
$mo = param('month');
$yr = param('year');
print "You are transferring all data modified on or after ", $dy, "-", $mo,"-", $yr, " to update";
print "\n";
print "QRX4: Starting script with /opt/oracle/scripts/staging/cerebellum/refresh.sh $dy-$mo-$yr\n";
print "<A HREF="http://parietal.corpdc.epocrates.com/cgi-bin/staging/productionDater_dev02.pl>Return to previous page</A>",hr;
print "<pre>";
system "/opt/oracle/scripts/staging/refresh.sh gui4 pwd1 qrx4 pwd2 $dy-$mo-$yr dev02";
print "</pre><hr>";
print "<A HREF="http://parietal.corpdc.epocrates.com/cgi-bin/staging/productionDater_dev02.pl>Return to previous page</A>",hr;
print end_html;
}
