in reply to Matching a truncated word

Well, one possibility isn't to use a regex, but instead to do something like:

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;

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.