Solved

Error Server question

Posted on 1998-08-12
11
184 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
git fat pull happens nothing in centos 6.3 python 2.6.6 33 207
Add additional column to .csv using Perl. 8 128
Replace  text in a file 2 97
File Find regex problem 4 60
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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 …
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…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

15 Experts available now in Live!

Get 1:1 Help Now