Solved

Error Server question

Posted on 1998-08-12
11
182 Views
Last Modified: 2010-03-05
Hi,
I use this command :
@wUserInfo=`cocdir -u $wUserId` ; in my CGI perl program.
The problem is if the command "cocdir" find nothing,
It produce an "server error" message. How can I do
to know if it found nothing or do another command
before the program generate the web page that
display the "server error" message.

Thank.
0
Comment
Question by:woaini
  • 5
  • 5
11 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1209229
if( $wUserInfo[0] =~ /server error/ )
0
 

Author Comment

by:woaini
ID: 1209230
It doesn't work.
Here are the message error :
-----
Server Error

This server has encountered an internal error which prevents it from fulfilling your request. The most likely cause is a misconfiguration. Please ask the administrator to look for messages in the server's error log.
-----
Any code after this line of code won't work
@wUserInfo=`cocdir -u $wUserId` ;

event "exit;"

So I need something inside this line of code
@wUserInfo=`cocdir -u $wUserId` ;
to prevent the browser to display the server error
message above. ex: die, etc...

Thank.
0
 

Expert Comment

by:kaijen
ID: 1209231
I suggest looking at

ftp://ftp.uni-hamburg.de/pub/soft/lang/perl/CPAN/doc/FAQs/cgi/idiots-guide.html
http://reference.perl.com/query.cgi?cgi

to get some general understanding of how CGI works. Inspite of the name - the first link
is great!

If if( $wUserInfo[0] =~ /server error/ ) doesn't work,
if( $wUserInfo[0] =~ /server error/i ) probably will do.

Best regards, Kai.
0
 

Author Comment

by:woaini
ID: 1209232
It doesn'r work.
How can I use a condition "IF" under the code
line
@wUserInfo=`cocdir -u $wUserId` ;
if the browser has already generated the web
page server error message ?
That mean it not pass throught this line of code
@wUserInfo=`cocdir -u $wUserId` ;
So how can I do to stop it ? may be with "die" ? or
???
0
 
LVL 84

Expert Comment

by:ozo
ID: 1209233
What does your CGI program do if you comment out the
# @wUserInfo=`cocdir -u $wUserId` ;
line?
And did you look for messages in the server error log?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 84

Expert Comment

by:ozo
ID: 1209234
#or try adding this to the top of your script:
open (STDERR, ">&STDOUT");
print "Content-type: text/plain\n\n";


0
 

Author Comment

by:woaini
ID: 1209235
Thank a lot Ozo ! how can I give you points ?
0
 

Author Comment

by:woaini
ID: 1209236
can you lock the question so I can give you the points.
Thank.
0
 
LVL 84

Accepted Solution

by:
ozo earned 20 total points
ID: 1209237
Ok.
0
 

Author Comment

by:woaini
ID: 1209238
Thank a lot ozo !
0
 
LVL 84

Expert Comment

by:ozo
ID: 1209239
You're welcome
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Perl - Mawk 2 69
Using Perl to parse rows 7 85
Using Perl DBI to query oracle 3 30
Perl string filter 5 65
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now