in reply to Re: Print word from text file that is not an exact match
in thread Print word from text file that is not an exact match
Regards, Tonymy $file = "computers.txt"; print "-->>Paste computer name(s) here, press enter key, then ctrl-D k +eys<<--\n"; @computers = (<STDIN>); foreach (@computers) { open FILE, "$file"; while ($line=<FILE>){ if (my ($name) = $line=~/(@computers[\.\w]*)/){ print "name\n"; else print "no match found\n"; close FILE, "$file"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Print word from text file that is not an exact match
by poj (Abbot) on Jun 09, 2018 at 18:27 UTC | |
by TonyNY (Beadle) on Jun 09, 2018 at 18:37 UTC | |
by poj (Abbot) on Jun 09, 2018 at 18:58 UTC | |
by TonyNY (Beadle) on Jun 09, 2018 at 21:45 UTC | |
by TonyNY (Beadle) on Jun 10, 2018 at 18:31 UTC | |
|