open (FILE, 'acrolist.txt'); my @lines = <FILE>; my @data; foreach my $line (@lines) { if ( $line =~ /$teststring/ ) { print "You have a MATCH: $1\n"; push @data, $line; } } print @data;
Is this what you are trying to do?
In reply to Re: returning matched word from string
by Lawliet
in thread returning matched word from string
by monaghan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |