in reply to Scoping issue when sorting with subroutines

If you are using a "global" variable (with use vars or our in perl5.6), you can accept it via $packagename::nos{$a}.

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"

  • Comment on Re: Scoping issue when sorting with subroutines