in reply to calling a sub from an if statement
use insteadif ($method ne "GET") { if ($method ne "POST") { msg(400); } }
Note that you probably want a return or and exit at this point, otherwise, you're going to continue executing code, after you've kicked an error message out. This is usually not what you want to do.if ($method ne "GET" && $method ne "POST") { msg(400); }
And, of course, as a responsible programmer, you'll be wanting to close the file when you're done with it. <G>open(FILE1, $ARGV[0]); @lines = <FILE1>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: (jcwren) Re: calling a sub from an if statement
by tye (Sage) on Jul 24, 2000 at 00:19 UTC |