Thanks to all for your replies, and yes, the perl script work the way I want it to from the command line using bl -g yes, I want to execute a perl script from the html page and have it post it's information into the html page. Most web reporting tools we use are built in CGI. However, I'm not to familiar with it. Most of our webtools start with HTML, then calls a cgi perl script, then that perl script calls for a script that queries the SQL database using bl -g. As for what I am trying to accomplish, I'll try to be exact and give my html source code and perl script. We have jobs that run, I'm using the perl script to query the database to extract just the end time of a job and place it in the "NA" section of the html table. I am not sure if HTML can do this, if not I will have to use CGI, but I want to keep with one web page, the HTML, if all possible. See below the HTML file called prodcyctest.html the perl script I'm trying to run is called dndhtest2pa.pl, the other pl script in the href is working fine. I need the new perl script to embed it's data where the "NA" is in the table.
<HTML> <BODY BGCOLOR='white'" TEXT=BLACK LINK=BLUE VLINK=PURPLE ALINK=RED > <META HTTP-EQUIV="REFRESH" CONTENT="30"> <HEAD> <TITLE>Production Cycle Report Automated Test</TITLE> </HEAD> <BODY> <STYLE TYPE="text/css"> <!-- H1 { color:blue; font-style:italic; } --> </STYLE> <H1> <center>CG Production Cycle Report - TEST</H1> <SCRIPT TYPE="text/javascript"> <!-- Begin // Get today's current date. var now = new Date(); // Array list of days. var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday +','Friday','Saturday'); // Array list of months. var months = new Array('January','February','March','April','May','Jun +e','July','August','September','October','November','December'); // Calculate the number of the current day in the week. var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); // Calculate four digit year. function fourdigits(number) { return (number < 1000) ? number + 1900 : number; } // Join it all together today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ; // Print out the data. document.write(today); // End --> </script> <SCRIPT Language="JavaScript"> <!-- hide from old browsers // Copyright 1999, 2000 by Ray Stott // OK to use if this copyright is included // Script available at http://www.crays.com/jsc var TimezoneOffset = -8 // adjust for time zone var localTime = new Date() var ms = localTime.getTime() + (localTime.getTimezoneOffset() * 60000) + TimezoneOffset * 3600000 var time = new Date(ms) var hour = time.getHours() var minute = time.getMinutes() var second = time.getSeconds() var curTime = "" + ((hour > 12) ? hour - 12 : hour) if(hour==0) curTime = "12" curTime += ((minute < 10) ? ":0" : ":") + minute curTime += ((second < 10) ? ":0" : ":") + second curTime += (hour >= 12) ? " PM" : " AM" document.write(curTime + " US Pacific Time") //--> </SCRIPT> <TABLE BORDER=2 CELLSPACING=6> <TR> <TH>Key Milestones</TH> <TH>Job Name</TH> <TH>Completed T +ime in PST</TH> <TH>SLA</TH> </TR> <TR> <TD>Transaction Handoff PA to MARS CGTC/CII</TD> <TD><LI><A HREF= +'/cgi-bin/autorep_dev_vsl.pl?job_name=pa_box_settle&level=detail'>pa_ +box_settle</A> </TD> <TD>NA</TD> <TD>8:45pm</TD> </TR> <TR> <TD>Transaction Handoff PA2 to MARS CRMC</TD> <TD><LI><A HREF= +'/cgi-bin/autorep_dev_vsl.pl?job_name=pa2_box_settle&level=detail'>pa +2_box_settle</A> </TD> <TD>NA</TD> <TD>8:30pm</TD> </TR> <TR> <TD>Transaction Handoff PA3 to MARS</TD> <TD><LI><A HREF= +'/cgi-bin/autorep_dev_vsl.pl?job_name=pa3_box_settle&level=detail'>pa +3_box_settle</A> </TD> <TD>NA</TD> <TD>8:30pm</TD> </TR> </TABLE> <STYLE TYPE="text/css"> <!-- H2 { color:blue; font-size:10pt; } --> </STYLE> <H2> <center>Click on job name to view job information</H2> </BODY> </HTML>
Here is the perl script, it's setup to return Jobname, Last Start and End Time, but I have commented that out and just want the end time, again, the script works fine from the command line.
#!/users/contrib/bin/perl use Sybase::Sybperl; use Env qw(BATCH_USER_NAME BATCH_PASSWORD); ############## ############## Subroutines ############## # Send the input string to the DB server and get the results # $_[0] - sql string sub DBEXEC { &dbcmd($dbproc, $_[0]); &dbsqlexec($dbproc); &dbresults($dbproc); } # Turn UTC in to people time sub GETTIME { if ($_[0] eq "999999999") { $time = ("******** **********"); } elsif ($_[0] eq "0") { $time = ("******** **********"); } else { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime( +$_[0]); $mon++; $time = sprintf ("%.2d:%.2d:%.2d %.2d/%.2d/%.2d", $hour, $min, $se +c, $mon, $mday, $year + 1900); } } # set job status sub JOBSTATUS { if ($_[0] == 9) {$jstatus1 = ("ACTIVATED");} elsif ($_[0] == 5) {$jstatus2 = ("FAILURE");} elsif ($_[0] == 8) {$jstatus3 = ("INACTIVE");} elsif ($_[0] == 11) {$jstatus4 = ("ON_HOLD");} elsif ($_[0] == 7) {$jstatus5 = ("ON_ICE");} elsif ($_[0] == 12) {$jstatus5 = ("QUE_WAIT");} elsif ($_[0] == 10) {$jstatus6 = ("RESTART");} elsif ($_[0] == 1) {$jstatus7 = ("RUNNING");} elsif ($_[0] == 3) {$jstatus8 = ("STARTING");} elsif ($_[0] == 4) {$jstatus9 = ("SUCCESS");} elsif ($_[0] == 6) {$jstatus10 = ("TERMINATED");} } ############ Setup report format ############ format STDOUT = @<<<<<<<<<<<<<<<<<<<<< $etime . ############ ############ Start ############ # if ($ARGV[0] eq "print") { # open(STDOUT,"| lp -dbigtooth -o2"); # } # else { # open(STDOUT,"| elm -s 'Nightly cycle check' \xxxxxxxx\@smtplink"); # } # login to the database $dbproc = &dblogin($BATCH_USER_NAME, $BATCH_PASSWORD, 'SQL_AUTOSYS_DEV +'); #$currdate = &GETTIME(time); #print "Date: $currdate \n\n"; #print " \n"; #print "Jobname Last Start Last End + \n"; #print "------------------------------ -------------------- ---------- +----------\n"; # Submit SQL Statement &DBEXEC("select job.job_name, job_status.last_start, job_status.la +st_end from job, job_status where job.joid = job_status.joid and job.job_name in ('pa_box_settle') order by job_status.last_end"); while(@status = &dbnextrow($dbproc)){ $name = ($status[0]); $stime = &GETTIME($status[1]); $etime = &GETTIME($status[2]); write(STDOUT);} #print "\n\n"; print " \n"; close(STDOUT);
Again, thanks, just learning, and wondering if HTML can even do what I'm trying to make it do with the perl script

In reply to Re^2: Question about HTML and Perl by CG_man
in thread Question about HTML and Perl by CG_man

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.