in reply to Find strings

It seems that on DOS, the line endings are not recognized, thus the whole content ends up as a single logical line in your program.

Since I don't have DOS available I can't test my suggestion, but after reading Perlio I guess a binmode F, ":raw";

After the line with the open should help.

By the way you should always check if system calls like open() actually succeed:

open my $f, '<', 'text.txt' or die "can't open file 'text.txt' for reading: $!"; binmode $f, ':raw'; while (<$f>) { print "Result: $1" if /particularly(.*)/; }
Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: Find strings
by toros (Initiate) on Oct 01, 2010 at 08:33 UTC
    Sorry, i know little english. It would be nice to have a small sample. This example is important to me. Thank you moritz for reply
      I've now included the binmode call in my previous reply.