It would no longer match do to the fact that the match must match the exact string passed
But the \b assertion does not require an "exact" match, as I understand the term, but rather the presence of a word boundary (based on the \w character class). So you can have the following "exact" match with 'Ba':
See Assertions.c:\@Work\Perl\monks>perl -wMstrict -le "use List::MoreUtils qw(any); ;; my $match = 'Ba'; my @array = ('Ba Ba Black Sheep'); ;; print 'exact match?' if any { /\b$match\b/ } @array; " exact match?
Give a man a fish: <%-(-(-(-<
In reply to Re^4: Comparison between a string and an array
by AnomalousMonk
in thread Comparison between a string and an array
by Eth443
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |