in reply to What's the best way to get first character of the string?
The two do not produce the same results. Something to consider when you do convert, but not something to keep you from doing so. Using a regex for this type of task is incredible inefficient in comparison to substr.$_="\n"; my ($letter) = /^(.)/; print "Regex: '$letter'\n"; $letter=substr($_,0,1); print "Substr:'$letter'\n";
Yves / DeMerphq
--
Have you registered your Name Space?
|
|---|