Help for this page

Select Code to Download


  1. or download this
    open FILE, 'test_file.txt' || die "$!\n";
    my $text = join( '', @{ [ <FILE> ] } );
    ...
    
    die "The file supplied is not of unix format!\n" if ( $text =~ /\r\n/ 
    +);
    
  2. or download this
    open FILE, 'test_file.txt' || die "$!\n";
    while ( my $line = <FILE> ) {
    ...
      last;
    }
    close FILE;