Re: Sorting from subroutine call

2006-12-02 Thread Sergio Escalada
Yes! It was exactly what I was trying to do. I wasn't so wrong after all. Thanks you, Dani, your code helps me a lot :D 2006/12/2, D. Bolliger <[EMAIL PROTECTED]>: Sergio Escalada am Samstag, 2. Dezember 2006 15:41: > Thanks for replies. > > The purpouse of this mini-s

Re: Sorting from subroutine call

2006-12-02 Thread Sergio Escalada
# # hashref? Why in the WORLD is the database being kept in a hashref? # Oh, it's an exercise for class, and I must keep data in a hashtable, it's not my fault ^_^ Thanks for your code :) # # if you have a small number of columns you want to sort by, build a # simple subroutine to sort by

Re: Sorting from subroutine call

2006-12-02 Thread Sergio Escalada
Thanks for replies. The purpouse of this mini-script is to list the rows from a database loaded in memory ($ref_db is the reference to hashtable that cotains the DB). So I want to order the fields by different sort rules, and make the proccess as abstract as it's possible with a subrutine (sub cm

Sorting from subroutine call

2006-12-02 Thread Sergio Escalada
Hi all! I would like to know if it's possible to make an array sorting with a subroutine call. Usually, a sort is made as, for example: sort {$a <=> $b} @array; But my intention is something like: sort subroutine_call @array; sub subroutine { $a <=> $b; } How could I do it? Thanks. Ser