Using a Module from the Standard Perl Library in a Script) : Module « Language Basics « Perl






Using a Module from the Standard Perl Library in a Script)

   

#!/bin/perl
use Carp qw(cluck);  

print "Number: ";
$grade = <STDIN>;
try($grade);     # Call subroutine
sub try{
    my($number)=@_;
    cluck "Illegal value: " if $number < 0 || $number > 100;
}
print "That was just a warning. Program continues here.\n";

   
    
    
  








Related examples in the same category

1.Using Perl to Create Your Own Module
2.Using a Perl 5 Module from the Standard Perl Library
3.Libraries and Modules