To exit a Perl script, use the die function or the exit function. : exit « System Functions « Perl






To exit a Perl script, use the die function or the exit function.

      

open(FH, "filename") or die "Couldn't open filename: $!\n";
if ($input !~ /^\d+$/){
       print STDERR "Bad input. Integer required.\n";
       exit(1);
}

   
    
    
    
    
    
  








Related examples in the same category

1.Using exit command to exit an program