in reply to Sorting a subset

Hmmm.

for (map "A$_", sort { $a <=> $b } map /^A\d+$/ ? substr($_,1) : (), @ +array) { ...

Just another way. I am assuming you wanted numeric comparison. I also took the liberty of filtering out inputs not of the form A followed by numeric digits. Apologies for allowing neither negatives nor decimals.

Although:

for (sort grep /^A/, @array) { ...

Would work if you just want it for strings starting with A.