in reply to Matching First Character of Strings Efficiently


Here is an efficient snippet that I posted a while back, complete with benchmark: Read the first character of a string.
$char = chr ord $string;

But if you don't care what the character actually is you could just use ord (as tye shows above).

--
John.