$ perl -le' my $string = "YANDS"; print reverse $string =~ /(.)(.*)(.)/; ' SANDY