This example fails because it'll also return true if non-alphabetic characters match. You specified "letters".
sub first_character_matches { return( ((lc shift) ^ (lc shift)) =~ /^\0/ ); }
And a command-line version to play with:
1) poerbook:~% perl -wle 'print "yes" if ( ((lc shift) ^ (lc shift)) = +~ /^\0/ )' abc DBC 1) poerbook:~% perl -wle 'print "yes" if ( ((lc shift) ^ (lc shift)) = +~ /^\0/ )' abc ABC yes
In reply to Re: Matching first Letters of two words
by rcaputo
in thread Matching first Letters of two words
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |