Hi all,

Been banging my head on this, I'm obviously missing something obvious, but I can't see what. Would someone put me out of my misery?

My code checks the value of a variable $status. $status can have three values, 0,1,2. 0 is good, 1 and 2 are errors. So;

use strict;

if ($status) {
        error($status);
}

< DO STUFF>

sub error {

<Print top half of a HTML page>

        if ($_[0]=1) {
        <print rest of the page with the error 1 message>
        }
        else {
        <print rest of the page with the error 2 message>
        }
}

With all of the sub definition commented out the code checks OK with perl -cT (Q. should that happen if I call a sub that I comment out when I'm using strict?) But with the sub definition back in, perl -cT throws up a syntax error at sub error {, and another syntax error at if($_[0]=1){

What have I forgotten from this code?

Thanks

Dave




-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to