How about something like:
my ($word1, $word2) = split(/\s+/); if defined($word2) { ... }
instead of:
foreach $word (split /\s+/) { ... }
In other words, don't loop over every word. Get the first two words of every line, and work with those.
In reply to Re: Word Pairs and Lines
by ikegami
in thread Word Pairs and Lines
by bob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |