in reply to Syntax error sorting hash keys

Hi,
You are useing a prototype for your function that accepts
no arguments: sub xls () {}
So you cannot pass any arguments to this function.
If you drop the parenthesis it should work (at least from a syntactic
point of view). To get the sorted output see the answer by Velaki
si_lence

Replies are listed 'Best First'.
Re^2: Syntax error sorting hash keys
by revdiablo (Prior) on Dec 13, 2004 at 19:25 UTC
    So you cannot pass any arguments to this function.

    Only if the function is declared before the use. If the function is used before it is declared, the prototype will not have a chance to be enforced. Of course, if the OP was using warnings, he would get a "sub called too early to check prototype" message in this case.

    Update: just to make it clear, I am not endorsing the use of empty prototypes, just further explaining the behavior.