Solved

Error Server question

Posted on 1998-08-12
11
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Uploading Binary Data using Perl 5 99
Perl efficient DB Call 8 96
crawling gofundme 4 143
Perl passing in variables to do substitution 6 78
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

763 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