Help for this page

Select Code to Download


  1. or download this
    [mylibrary1.pl]
    
    ...
       my $number = shift;
       return $number / 2;
    }
    
  2. or download this
    [mylibrary1.pm]
    
    ...
    
    1; # All .pm files must end with a true value
    __END__
    
  3. or download this
    [myscript.pl]
    
    require 'mylibrary1.pl';
    
    print half( 10 ), "\n";
    
  4. or download this
    [myscript.pl]
    
    use mylibrary1 qw( half );
    
    print half( 10 ), "\n";
    
  5. or download this
    use Foo; # Imports everything in @EXPORT, nothing in @EXPORT_OK
    
    use Foo 'bar'; # Imports 'bar' if it's in @EXPORT_OK. Imports nothing 
    +from @EXPORT
    
    use Foo (); # Imports NOTHING from either.