use strict; use warnings; my $file = 'search.txt'; open my $fh, $file or die $!; while (<$fh>) { print "$1\n" if /Name:\s*(.*)/; }
In reply to Re: Scanning a file for a match, printing different part of the line when found.
by wind
in thread Scanning a file for a match, printing different part of the line when found.
by cheech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |