Help for this page

Select Code to Download


  1. or download this
    #! /usr/bin/perl
    use warnings;
    use strict;
    use diagnostics;
    
  2. or download this
    use warnings;
    use strict;
    my $filename = 'notepad |';
    open( my $FH, $filename ) or die "Can't open '$filename': $!\n";
    
  3. or download this
    use warnings;
    use strict;
    my $filename = 'notepad |';
    open( my $FH, "<", $filename ) or die $!;
    
  4. or download this
    my $filename = 'notepad |';
    unless( -f $filename ) {
        die "Error: file '$filename' is not existing\n";
    } # unless
    
  5. or download this
    #! /usr/bin/perl
    use warnings;
    ...
        or die "Error: can't close '$outfile' for writing: $!\n";
    
    print qq~There were $count instances of "and" in '$infile'\n";