I am trying to write a program to print all matching lines of a pattern
#!/usr/bin/perl; use warnings; use strict; my $filename = 'C:\Perl\example.txt'; open (my $fh, '<' ,$filename) or die "ERROR: could not open $filename: + $!"; while (<>) { if (/fred/) { print ; } } close ($fh);
In reply to My program hangs by surenbika
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |