Exit a Script or Subroutine in Perl
To exit a script or subroutine in Perl place...
exit;
...wherever you want the script to quit.
-Anything placed after exit will not execute.
-Handy for stopping a script if a condition is met.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "Let's exit!<br>";
$ji=42;
if ($ji eq 33) {
print "Not 42";
}
if ($ji eq 42) {
print "IS 42";
exit;
}
### this code won't execute if $ji equals 42
print "Happy Day!";
### End of Copy and Paste Perl Code
Click HERE to comment or discuss at iLoveTheCode GOOGLE Group