my @word = split //, $word_to_match; my $match = 0; for (0 .. $#word) { $match = 1 && last if $word_to_compare eq join //, @word[0..$_]; } print "Matched!\n" if $match;
In reply to Re: Matching a truncated word
by dragonchild
in thread Matching a truncated word
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |