in reply to How do I capture the last character in a string?

my ($last) = $x =~ /(.)$/;
This'll work in nearly all applications.
my $last = substr $x, -1, 1;
That'll work in all applications.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.