newbie question...can't die..whod a thunk it?

D

die

Is there any reason the script below should not print the message after
'die'?Thanks.
----------------------------------------------------
$var1='a';
$var2='b';

print"Content-type:text/html\n\n";

$var1 eq "$var2" or die "PERL die function\n";
----------------------------------------------------
 
A

Anno Siegel

die said:
Is there any reason the script below should not print the message after
'die'?Thanks.
----------------------------------------------------
$var1='a';
$var2='b';

print"Content-type:text/html\n\n";

$var1 eq "$var2" or die "PERL die function\n";
----------------------------------------------------

No.

Anno
 
G

Gunnar Hjalmarsson

die said:
Is there any reason the script below should not print the message after
'die'?Thanks.
----------------------------------------------------
$var1='a';
$var2='b';

print"Content-type:text/html\n\n";

$var1 eq "$var2" or die "PERL die function\n";
----------------------------------------------------

No. However, die statements are printed to STDERR by default, so if you
run the script from the browser, i.e. as a CGI script, you won't see the
message on the screen. To change that, you can add this line at the
beginning of the script:

use CGI::Carp 'fatalsToBrowser';
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top