Help for this page

Select Code to Download


  1. or download this
    use v5.18;
    
    ...
    sub mySub {
        say "This is mySub, foo!";
    }
    
  2. or download this
    #!/usr/bin/perl
    use v5.18;
    ...
    
    open( my $dne, '<', 'nonexistentfile.txt' );
    die 'Failed to import autodie';
    
  3. or download this
    peter@hermes:~/src/Perl/test> perl myscript.pl 
    This is mySub, foo!
    ...
    Perl can't read.
    Can't open(GLOB(0x9cc7d8), <, nonexistentfile.txt): No such file or di
    +rectory at (eval 3) line 4.
            main::__ANON__('GLOB(0x9cc7d8)', '<', 'nonexistentfile.txt') c
    +alled at myscript.pl line 22