Perl Script remove digits and convert

Hello Guy's
Quick question which im sure many can answer in seconds. Basically I have a perl script which is running commands to an element and then taking some of the
the output and printing it to the screen. One of the outputs is a variable Hex Number. What I would like to do is strip all the digits from this number apart from the
last 2 and then convert the last two digits to decimals.

I have taken some of the Script and printed below so you get an idea of what im doing.

my $cid;
        if ($ip) {
                for (`./ssh_run_cmd.exp $target $password "show **** ***** ****** $ex1"`) {
                        if (/0x\S+\s+(\S+)/) {
                                $cid = $1;   # THIS IS WHERE THE HEX NUMBER IS PULLED (EXAMPLE  0x11d14)
                                last;
                        }
                }
        }
        if ($ip) {
                for (`./ssh_run_cmd.exp $target $password "show ****** ******* ****** **** peer-address $ip"`) {
                       if (/*********\s+:\s+(\S+)/) {
                           print "Found $EXP1 in ", ( $activeoridle ? 'Idle' : 'Active' ), " mode  registered on ", $targets{$target}, " and using $1\n";
                                exit 0;

As you can see in the first section $cid is pulled from the output and then essentially what I would like to do is edit the $cid only to take the last two digits
and then convert the the last two digits into decimal to be displayed in the print output at the end.

Thanks for everyone's help in advance.

So if I understood correctly, you want to:
(1) extract "14" from your example "0x11d14"
(2) consider 14 to be a hexadecimal number
(3) convert 14(hex) to dec, which is 20(dec), and
(4) assign 20 to $cid

Is that what you want to do?

If your example hexadecimal number was "0xabcde", would you want the conversion to be:

0xabcde => de => de(hex) = 222(dec) => 222 ?

$ 
$ perl -e 'BEGIN {$cid = "0x11d14"}  
           print "Original number                  : ", $cid, "\n";
           $cid =~ s/^.*(..)$/$1/;
           print "Last two characters              : ", $cid, "\n";
           print "Dec value of last two characters : ", hex($cid), "\n"
          '
Original number                  : 0x11d14
Last two characters              : 14
Dec value of last two characters : 20
$ 
$ 
$ perl -e 'BEGIN {$cid = "0xabcde"}
           print "Original number                  : ", $cid, "\n";
           $cid =~ s/^.*(..)$/$1/;
           print "Last two characters              : ", $cid, "\n";
           print "Dec value of last two characters : ", hex($cid), "\n"
          '
Original number                  : 0xabcde
Last two characters              : de
Dec value of last two characters : 222
$ 
$