Help for this page

Select Code to Download


  1. or download this
    local $/ = "\r\n"; # read with Windows-style endings
    while (<FH>) {
       print "Found: $_"; 
    }
    
  2. or download this
    use File::Slurp;
    my $content = read_file('my_file.txt');
    ...
    for ( split(/[\r\n]+/, $content) ) {
       print "Found: $_\n"; 
    }