in reply to Scoping issue when sorting with subroutines
If %nos is a local-Variable (my), you have to give it (or better a reference to it) to the subs &up and &down.
Best regards, perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"