RE: [cgiapp] CGI Error [Solved!!]
Commenting out the following lines in the CGI.PM resolved the error. I don't know if this is the correct way or not, if anyone has a different way to solve this, pls. let me know. Thanks Bal. #if ($dtd) { #if (defined(ref($dtd)) and (ref($dtd) eq 'ARRAY')) { #$dtd = $DEFAULT_DTD unless $dtd-[0] =~ m|^-//|; #} else { #$dtd = $DEFAULT_DTD unless $dtd =~ m|^-//|; #} #} else { #$dtd = $XHTML ? XHTML_DTD : $DEFAULT_DTD; #} # #$xml_dtd++ if ref($dtd) eq 'ARRAY' $dtd-[0] =~ /\bXHTML\b/i; #$xml_dtd++ if ref($dtd) eq '' $dtd =~ /\bXHTML\b/i; #push @result,q(?xml version=1.0 encoding=utf-8?) if $xml_dtd; # #if (ref($dtd) ref($dtd) eq 'ARRAY') { #push(@result,qq(!DOCTYPE html\n\tPUBLIC $dtd-[0]\n\t$dtd-[1])); #} else { #push(@result,qq(!DOCTYPE html\n\tPUBLIC $dtd)); #} #push(@result,$XHTML ? qq(htmlheadtitle$title/title) # : qq(html lang=$langheadtitle$title/title)); # push(@result,$XHTML ? qq(html xmlns=http://www.w3.org/1999/xhtml; lang=$langheadtitle$title/title) # : qq(html lang=$langheadtitle$title/title)); # if (defined $author) { #push(@result,$XHTML ? link rev=\made\ href=\mailto:$author\; / # : link rev=\made\ href=\mailto:$author\;); # } -Original Message- From: Sabherwal, Balvinder (MBS) [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 10:05 AM To: [EMAIL PROTECTED] Subject: [cgiapp] CGI Error Importance: High The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. A declaration was not closed. Error processing resource 'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1 Guru's I am getting error as mentioned above. This is being generated on the execution of a perl script which had been working fine in the past and nothing has been changed in this script. This script is based on the CGI::Application template. Any help would be greatly appreciated. Thanks Bal. - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [cgiapp] CGI Error [Solved!!]
Hi Bal -- Commenting out the following lines in the CGI.PM resolved the error. I don't know if this is the correct way or not, if anyone has a different way to solve this, pls. let me know. I would definitely NOT comment arbitrary lines from another module without understanding WHY doing so changes the situation. I am 100% positive that you have a bug in your code, and that there is no bug in CGI.pm which is causing this to happen. Before you go and comment out lines from CGI.pm, take a close look at the situation and figure out why commenting those lines seem to fix your problem. I am certain that you will discover a bug in your own code. -Jesse- - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [cgiapp] CGI Error [Solved!!]
I've seen this error before. Do you have 'friendly error messages' turned on in your IE settings? What is the output with this option off or with another non-IE browser? ... -Original Message- From: Sabherwal, Balvinder (MBS) [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 12:43 PM To: 'Jesse Erlbaum'; [EMAIL PROTECTED] Subject: RE: [cgiapp] CGI Error [Solved!!] Hi Jesse, I checked my code and couldn't find anything wrong in it. I don't know why the browser thinks it's and xml where as I am printing HTML all across the script. I am attaching the script herewith as well. If you or anyone on this list finds the bug, pls. let me know. Thanks Bal. # SCRIPT ## package perfmonpvt; use base 'CGI::Application'; use strict; use Sybase::CTlib; sub setup { my $self = shift; $self-start_mode('mode1'); $self-run_modes( 'mode1' = 'showsrvrs', 'mode2' = 'showdetails' ); } sub teardown { my $self = shift; } sub showsrvrs { my $self = shift; # Get CGI query object my $q = $self-query(); my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps', 'SYB_NJ6'); ## Connect to the server. $dbh-ct_sql('use perfmondb'); my $output = ''; if($dbh eq undef) { $output .= $q-start_html(); $output .= $q-blockquote(h1Connection to server failed. /h1); $output .= $q-blockquote(This could be due to an invalid Login Name,Password,Server Name.); $output .= $q-blockquote(If you feel all of these are correct, then pls check of the server is running and your login is not locked.); $output .= $q-blockquote(Still if you can't connect, Pls check you interfaces of sql.ini files.); $output .= $q-end_html(); return $output; exit 0; } my @srvrs; my $app= $dbh-ct_sql('select Name from Servers'); foreach my $row (@$app) { foreach my $col (@$row) { push(@srvrs,$col); } } $output .= $q-start_html(-title = 'Sysmon Details'); $output .= $q-blockquote($q-strong(h1Check Sysmon Details/h1)); $output .= $q-start_form(); { local($) = ''; $output .= $q-blockquote(Select Server : , $q-popup_menu(-name= 'srv', -values =\@srvrs)); } { local($) = ''; $output .= $q-blockquote(Select Item(s) : , $q-checkbox_group(-name= 'opt', -values =['CPU Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'], -default = 'CPU Busy' )); } { local($) = ''; $output .= $q-blockquote(Start Date : , $q-textfield(-name= 'sdt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(End Date : , $q-textfield(-name= 'edt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(Show Data Values : , $q-radio_group(-name= 'gv', -values =['Yes','No'], -default = 'Yes' )); } { local($) = ''; $output .= $q-hidden(-name = 'rm', -value = 'mode2', -override=1 ); } { local($) = ''; $output .= $q-submit(View Report); } $output .= $q-end_form(); $output .= $q-end_html(); return $output; } sub showdetails { my $self = shift; #Get CGI query object my $q = $self-query(); my $srv = $q-param(srv); my @opt = $q-param(opt); my $sdt = $q-param(sdt); my $edt = $q-param(edt); my $gv = $q-param(gv); my $block = ; my $output = ''; foreach my $o (@opt) { $block = $block. '$o',; } $block = substr($block, 0, length($block) - 1); my $cmde = exec perfmondb..proc_sysmon_crosstab '$srv','$sdt','$edt', $block ; my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps', 'SYB_NJ6'); ## Connect to the server. $output .= $q-start_html(-title = 'Sysmon Details'); if($dbh eq undef) { $output .= $q-blockquote(h1Connection to server failed. /h1); $output .= $q-blockquote(This could be due to an invalid Login Name,Password,Server Name.); $output .= $q-blockquote(If you feel all of these are correct, then pls check of the server is running and your login is not locked.); $output .= $q-blockquote(Still if you can't connect, Pls check you interfaces of sql.ini files.); $output .= $q-end_html(); return $output; exit 0; } $dbh-ct_sql(use perfmondb); my (@dr,$ret); $dbh-ct_execute($cmde); $output .= $q-blockquote(h1Check Sysmon Details/h1); $output .= $q-blockquote(Selected Server : $srv); $output .= $q-blockquote(Selected Report : $block); $output .= $q-start_form(); $output .= $q-hidden(-name = 'rm', -value =
[cgiapp] # increment
Hi all, I am appending the web input to a txt file , but i need to increment the number 1,2 etc.. in the txt file based on each input which i receive from the web.Can you suggest something for this. Thanks Suthakar - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [cgiapp] CGI Error [Solved!!]
Bal -- I checked my code and couldn't find anything wrong in it. I don't know why the browser thinks it's and xml where as I am printing HTML all across the script. I am attaching the script herewith as well. If you or anyone on this list finds the bug, pls. let me know. My initial instict is that you've got an extra or missing } somewhere. First off, fix your indenting -- it's unworkable. If you make your intending consistant that will probably help you identify your problem right there. E.g.: sub some_mode { my $self = shift; if ($self-is_something()) { return $self-do_something_else(); } my $count = 0; while ($self-stuff_is_true()) { $count++; if ($count%10) { $self-count_mod_ten(); } } return Weouttahere...; } ...Note that you can visually trace any closing brace to its source by going straight up. No guesswork required. Basic stuff aside, I see one scary exit(0) in there. That's a big no-no. In this case it will never execute (you return() first), but in general you should either exit (or die), or return output -- not both. -Jesse- - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [cgiapp] # increment
Hi Suthakar -- I am appending the web input to a txt file , but i need to increment the number 1,2 etc.. in the txt file based on each input which i receive from the web.Can you suggest something for this. Assuming you don't have access to a relational database (which would obviate the need for the text file), to maintain a serial number you will need to maintain the state of your counter somewhere on the web server. In your case, this is probably going to mean maintaining a second text file to which the web server have write access. This file should contain the highest number used. Whenever you have to write an entry to your text file, use this state file to get the next highest number, then update the state file with the new high number. A critical thing to remember is that you have to LOCK this file, lest another user session simultaneously write to this file. Locking will cause any concurrent request to wait (block is the technical term) until the first process is done. There are many Perl modules which support locking. Search CPAN for one which suits your tastes. TTYL, -Jesse- Jesse Erlbaum, CTO Vanguard Media http://www.vm.com 212.242.5317 x115 [EMAIL PROTECTED] - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] CGI Error [Solved!!]
You should run your script from the command line to see what the output is (or telnet to the server). When you find out what the output is, you might be able to find out what about that output your browser does not like. When you find out exactly what the browser does not like, you might be able to figure out how to fix it. regards, Brian Sabherwal, Balvinder (MBS) wrote: Hi Cory, Yes, the option is turned on and the error msg I get was in the first mail. The browser thinks its an xml file and complaints that it can't parse the xml style sheet. This is the case with the non IE browsers as well. # ERROR MSG In the browser : # The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. A declaration was not closed. Error processing resource 'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1 Thanks Bal. -Original Message- From: Cory Trese [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 12:54 PM To: [EMAIL PROTECTED] Subject: RE: [cgiapp] CGI Error [Solved!!] I've seen this error before. Do you have 'friendly error messages' turned on in your IE settings? What is the output with this option off or with another non-IE browser? ... -Original Message- From: Sabherwal, Balvinder (MBS) [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 12:43 PM To: 'Jesse Erlbaum'; [EMAIL PROTECTED] Subject: RE: [cgiapp] CGI Error [Solved!!] Hi Jesse, I checked my code and couldn't find anything wrong in it. I don't know why the browser thinks it's and xml where as I am printing HTML all across the script. I am attaching the script herewith as well. If you or anyone on this list finds the bug, pls. let me know. Thanks Bal. # SCRIPT ## package perfmonpvt; use base 'CGI::Application'; use strict; use Sybase::CTlib; sub setup { my $self = shift; $self-start_mode('mode1'); $self-run_modes( 'mode1' = 'showsrvrs', 'mode2' = 'showdetails' ); } sub teardown { my $self = shift; } sub showsrvrs { my $self = shift; # Get CGI query object my $q = $self-query(); my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps', 'SYB_NJ6'); ## Connect to the server. $dbh-ct_sql('use perfmondb'); my $output = ''; if($dbh eq undef) { $output .= $q-start_html(); $output .= $q-blockquote(h1Connection to server failed. /h1); $output .= $q-blockquote(This could be due to an invalid Login Name,Password,Server Name.); $output .= $q-blockquote(If you feel all of these are correct, then pls check of the server is running and your login is not locked.); $output .= $q-blockquote(Still if you can't connect, Pls check you interfaces of sql.ini files.); $output .= $q-end_html(); return $output; exit 0; } my @srvrs; my $app= $dbh-ct_sql('select Name from Servers'); foreach my $row (@$app) { foreach my $col (@$row) { push(@srvrs,$col); } } $output .= $q-start_html(-title = 'Sysmon Details'); $output .= $q-blockquote($q-strong(h1Check Sysmon Details/h1)); $output .= $q-start_form(); { local($) = ''; $output .= $q-blockquote(Select Server : , $q-popup_menu(-name= 'srv', -values =\@srvrs)); } { local($) = ''; $output .= $q-blockquote(Select Item(s) : , $q-checkbox_group(-name= 'opt', -values =['CPU Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'], -default = 'CPU Busy' )); } { local($) = ''; $output .= $q-blockquote(Start Date : , $q-textfield(-name= 'sdt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(End Date : , $q-textfield(-name= 'edt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(Show Data Values : , $q-radio_group(-name= 'gv', -values =['Yes','No'], -default = 'Yes' )); } { local($) = ''; $output .= $q-hidden(-name = 'rm', -value = 'mode2', -override=1 ); } { local($) = ''; $output .= $q-submit(View Report); } $output .= $q-end_form(); $output .= $q-end_html(); return $output; } sub showdetails { my $self = shift; #Get CGI query object my $q = $self-query(); my $srv = $q-param(srv); my @opt = $q-param(opt);
RE: [cgiapp] CGI Error [Solved!!]
My thought was that with Lynx or IE (perhaps without the friendly setting) would yield the section of the document that looked like XML. -- Cory -Original Message- From: Brian Parker [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 1:46 PM To: [EMAIL PROTECTED] Subject: Re: [cgiapp] CGI Error [Solved!!] You should run your script from the command line to see what the output is (or telnet to the server). When you find out what the output is, you might be able to find out what about that output your browser does not like. When you find out exactly what the browser does not like, you might be able to figure out how to fix it. regards, Brian Sabherwal, Balvinder (MBS) wrote: Hi Cory, Yes, the option is turned on and the error msg I get was in the first mail. The browser thinks its an xml file and complaints that it can't parse the xml style sheet. This is the case with the non IE browsers as well. # ERROR MSG In the browser : # The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -- -- A declaration was not closed. Error processing resource 'http://dbainet/cgi-bin/graphpvt.cgi'. Line 1, Position 1 Thanks Bal. -Original Message- From: Cory Trese [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 12:54 PM To: [EMAIL PROTECTED] Subject: RE: [cgiapp] CGI Error [Solved!!] I've seen this error before. Do you have 'friendly error messages' turned on in your IE settings? What is the output with this option off or with another non-IE browser? ... -Original Message- From: Sabherwal, Balvinder (MBS) [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 12:43 PM To: 'Jesse Erlbaum'; [EMAIL PROTECTED] Subject: RE: [cgiapp] CGI Error [Solved!!] Hi Jesse, I checked my code and couldn't find anything wrong in it. I don't know why the browser thinks it's and xml where as I am printing HTML all across the script. I am attaching the script herewith as well. If you or anyone on this list finds the bug, pls. let me know. Thanks Bal. # SCRIPT ## package perfmonpvt; use base 'CGI::Application'; use strict; use Sybase::CTlib; sub setup { my $self = shift; $self-start_mode('mode1'); $self-run_modes( 'mode1' = 'showsrvrs', 'mode2' = 'showdetails' ); } sub teardown { my $self = shift; } sub showsrvrs { my $self = shift; # Get CGI query object my $q = $self-query(); my $dbh = Sybase::CTlib-ct_connect('perfmon', 'perfmon_ps', 'SYB_NJ6'); ## Connect to the server. $dbh-ct_sql('use perfmondb'); my $output = ''; if($dbh eq undef) { $output .= $q-start_html(); $output .= $q-blockquote(h1Connection to server failed. /h1); $output .= $q-blockquote(This could be due to an invalid Login Name,Password,Server Name.); $output .= $q-blockquote(If you feel all of these are correct, then pls check of the server is running and your login is not locked.); $output .= $q-blockquote(Still if you can't connect, Pls check you interfaces of sql.ini files.); $output .= $q-end_html(); return $output; exit 0; } my @srvrs; my $app= $dbh-ct_sql('select Name from Servers'); foreach my $row (@$app) { foreach my $col (@$row) { push(@srvrs,$col); } } $output .= $q-start_html(-title = 'Sysmon Details'); $output .= $q-blockquote($q-strong(h1Check Sysmon Details/h1)); $output .= $q-start_form(); { local($) = ''; $output .= $q-blockquote(Select Server : , $q-popup_menu(-name= 'srv', -values =\@srvrs)); } { local($) = ''; $output .= $q-blockquote(Select Item(s) : , $q-checkbox_group(-name= 'opt', -values =['CPU Busy','TPS','Deadlocks','IUD','Switches','Locks','Spinlock'], -default = 'CPU Busy' )); } { local($) = ''; $output .= $q-blockquote(Start Date : , $q-textfield(-name= 'sdt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(End Date : , $q-textfield(-name= 'edt'), Format: mmm dd or mm/dd/); } { local($) = ''; $output .= $q-blockquote(Show Data Values : , $q-radio_group(-name= 'gv', -values =['Yes','No'], -default = 'Yes' ));
RE: [cgiapp] CGI Error [Solved!!]
Sorry about the attribution (*%@#*^$ Notes) $output .= $q-header_props(-type =image/$format); $output .= $q-blockquote(); $output .= $q-blockquote(Centerh2Graph/h2/Center); my ($usr, $stim, $cusr, $cstim) = times; $output .= CenterIMG SRC=\http://dbainet/pvtgraph.png?$stim?$usr?cusr?cstim\;/Center; Is this snippet of code correct? Why would center, h2, and img tags be present in any document whose header identified itself as an image/FOO? OTOH, it has been a while since I looked at doing stuff like this. Brian - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] HElp IDE!!
Ernesto wrote: I'm looking for a develop enviroment to work on my cgi archives, i'm tired to work on pico linux editor :=) Then i would like to work on something more friendly . . . i myself use vim, screen, and a web browser for all my development needs. vim's got the syntax highlighting and screen gives me a quick way to edit other files, see error/access logs, etc. and a browser lets me see the results of my code. nothin' much else to it. cheers, twkonefal -- The stuff you own ends up owning you ... It's only after you've lost everything that you're free to do anything. --tyler durden New Media Copyright Extensions Would Harm Canada: http://ansuz.sooke.bc.ca/icsub.html - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] HElp IDE!!
On Mon, 13 May 2002, tomasz konefal wrote: Ernesto wrote: I'm looking for a develop enviroment to work on my cgi archives, i'm tired to work on pico linux editor :=) Then i would like to work on something more friendly . . . i myself use vim, screen, and a web browser for all my development needs. vim's got the syntax highlighting and screen gives me a quick way to edit other files, see error/access logs, etc. and a browser lets me see the results of my code. nothin' much else to it. I also use vim and screen and am quite happy with it. One reason I like it is that whether I'm using my Mac at work or my FreeBSD machine at home, I can use vim and screen on the server and have the exact same editting environment. -mark http://mark.stosberg.com/ - Web Archive: http://www.mail-archive.com/cgiapp@lists.vm.com/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]