Jim Witte wrote: > > Hi, > > I'm running Apache on a MacOS X (10.1.2) box in IP-loopback mode, and > I'm experiementing with a CGI script that acts like a state-machine. I > cooked up the example at the bottom of the page. If I run it as is, it > runs fine. But if I comment out line 48, which tells &action1 to exit > when it finishes, the browser displays this message, after which it > executes &action2 (correctly): > > t2.pl: Argument "action2" isn't numeric in numeric eq (==) at <file > path> line 16. > > What does this mean,
It means that the string "action2" is not a number but you are using the numeric equality (==) operator instead of eq. > and why does it only show up if the exit() statment is commented? > If I run it at the command line, it runs fine, > exept it tells me that &action1 and &action2 are called too early to > check their prototypes (which I expected). If I change the quotes in > lines 14 and 16 to double-quotes, it sill exibits the same behavior. > > > #!/usr/bin/perl > use CGI qw(:standard); > use diagnostics; > use CGI::Carp qw(fatalsToBrowser); > BEGIN { > use CGI::Carp qw(carpout); > carpout(STDOUT); > } > $commname = param('commname'); > if (!$commname) { > dostart(); } > if ($commname == 'action1') { ^^ eq > action1(); } > if ($commname == 'action2') { #### line 16 ^^ eq > action2(); } > > [snip code] John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]