in reply to first char of string?
This will snag any character, including embedded tabs, newlines, etc, etc. However, it is not as efficient as using substr (substr is a bit more than twice as fast in my tests).$_="Hello World!"; $_ =~ /^(.)/; print "The first character is: $1\n";
|
|---|