in reply to returning matched word from string
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: returning matched word from string
by toolic (Bishop) on Jul 23, 2008 at 00:53 UTC | |
by Lawliet (Curate) on Jul 23, 2008 at 01:13 UTC | |
|
Re^2: returning matched word from string
by monaghan (Novice) on Jul 23, 2008 at 00:40 UTC | |
by ikegami (Patriarch) on Jul 23, 2008 at 01:01 UTC | |
by monaghan (Novice) on Jul 23, 2008 at 18:38 UTC | |
by Lawliet (Curate) on Jul 23, 2008 at 00:46 UTC |