in reply to What's the best way to get first character of the string?

substr is probably the way to go.

For completeness, unpack should probably be put on the long list of other ways to do it.

my $str="hello world\n"; my $lchar=unpack('A1',$str); print "$lchar \n";


email: mandog