only reads one line from the file. You will need to loop through the file looking for your words. Secondly your pattern for a word is..interesting. I could just give you an RE that kind of works, but I suspect that you are really in need of a good basic introduction to the topic.my $file = <FILE>;
Theoretically complete documentation on how REs work can be found at perlre. But that is hard for most people to follow. japhy is in the process of writing a book on how to learn basic REs. You can see the start of it here, and his tool YAPE::Regex::Explain is invaluable.
And, of course, let me recommend merlyn's book, Learning Perl. It has an excellent review of basic Perl that should help you a lot.
In reply to Re (tilly) 1: returning word from a file position
by tilly
in thread returning word from a file position
by Kentdn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |