Help for this page

Select Code to Download


  1. or download this
    @array = <FILE>;
    
  2. or download this
    while(<FILE>) {
        push(@array, $_);
    }
    
  3. or download this
    open (DF, "test.txt") || die "Can't read 'test.txt': $!\n"
    
  4. or download this
    use strict;
    use warnings;
    
  5. or download this
    perl -MO=Deparse -e 'open (DF, "test.txt") || die "Cant read test.txt\
    +n";'
    
  6. or download this
    die "Can't read test.txt\n" unless open DF, 'test.txt';