Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        or die "Failed to open 'filename', $!";
    my @contents = <FILEHANDLE>;
    close FILEHANDLE;
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        or die "Failed to open 'filename', $!";
    my @contents = <$file>;
    $file->close();
    
  3. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        @elements = <$file>;
    }
    $file->close();