in reply to OO and sorting

Why not just call sort() from package SORT?

package SORT; use X; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(sorted); sub by_id { $a->id <=> $b->id; } sub sorted { sort by_id @_ } 1;

Replies are listed 'Best First'.
Re: Re: OO and sorting
by artist (Parson) on Jul 26, 2001 at 01:46 UTC
    Hi
    Thanks guys,
    Both approaches are working fine. I like BikeNomad's approach better as it looks simple and has potential to introduce more OO.
    Artist.