Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

RE: Dynamic sort algorithm selection

by dchetlin (Friar)
on Nov 15, 2000 at 05:53 UTC ( #41698=note: print w/replies, xml ) Need Help??


in reply to Dynamic sort algorithm selection

That should work just fine as you have it (and has worked that way as far back as 5.004, at least). You can have the name of the subroutine in the scalar passed to sort.

Not only that, but you can go one better. You can pass sort a reference to a subroutine. This is safer and cleaner and faster than using the name of the sub.

my $sortref = \&firstname_descending; my @order = sort $sortref keys %data;

For best results, combine this approach with a dispatch table that does your subroutine lookup.

-dlc

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://41698]
help
Chatterbox?
[choroba]: Also, I'd try starting the App with the US layout and switch to the dead keys layout later
[Tux]: no, it was not .xinput related, but that did ring a bell. digging in my $ENV I found the cause: XMODIFIERS=@im=xim
[Tux]: Héŀłő çřűèļ ŵøŗľđ, ıŧ'š ºvəř

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-09-25 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (290 votes). Check out past polls.

    Notices?