Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: OO and sorting

by bikeNomad (Priest)
on Jul 26, 2001 at 00:58 UTC ( [id://99799]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://99799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found