Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error Server question

Posted on 1998-08-12
11
Medium Priority
?
194 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 85

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 85

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 85

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 85

Accepted Solution

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

Author Comment

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

Expert Comment

by:ozo
ID: 1209239
You're welcome
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Six Sigma Control Plans

885 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