in reply to Reverse fraction of a string

Here's a solution for one interpretation of your question:

#!/usr/bin/perl use strict; use warnings; (my $string = shift()) =~ s/(\d+)/reverse $1/ge; print "$string\n";

Save as foo.pl and then call it as

foo.pl abc123def4567g890

to get output like

abc321def7654g098