Re: Efficient sorting of SNMP oids

2009-10-31 Thread Uri Guttman
> "AV" == Avleen Vig writes: AV> On Oct 31, 2009, at 22:17, Dave Hodgkinson wrote: >> >> Then build it in to your own dist tree. AV> Or better yet, extract the key functionality you need from the module AV> and mak it part of your script! Easy. and one more idea. sort::maker ac

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Philip Newton
2009/11/1 Avleen Vig : > On Oct 31, 2009, at 22:17, Dave Hodgkinson wrote: > >> >> On 31 Oct 2009, at 20:56, B Maqueira wrote: >>> >>> Using Sort::Key::OID or sort::maker would have been great, except that >>> we need to deploy the script to a rather large number of servers and it >>> is tradition

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Avleen Vig
On Oct 31, 2009, at 22:17, Dave Hodgkinson wrote: On 31 Oct 2009, at 20:56, B Maqueira wrote: Using Sort::Key::OID or sort::maker would have been great, except that we need to deploy the script to a rather large number of servers and it is traditionally long and painful to get modules ap

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Dave Hodgkinson
On 31 Oct 2009, at 20:56, B Maqueira wrote: Using Sort::Key::OID or sort::maker would have been great, except that we need to deploy the script to a rather large number of servers and it is traditionally long and painful to get modules approved and deployed in our machines. Then build it

Re: Efficient sorting of SNMP oids

2009-10-31 Thread B Maqueira
Peter Corlett wrote: > On 31 Oct 2009, at 16:03, B Maqueira wrote: >> I need to sort eficiently a large array (~9000) of SNMP OIDs. >> >> I am currently trying the following code: >> >> my @sorted_oids = map { $_->[0] } >> sort { $a->[1] cmp $b->[1] } >>

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Dave Hodgkinson
On 31 Oct 2009, at 16:03, B Maqueira wrote: Dear all, I need to sort eficiently a large array (~9000) of SNMP OIDs. I am currently trying the following code: my @sorted_oids = map { $_->[0] } sort { $a->[1] cmp $b->[1] } ma

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Peter Corlett
On 31 Oct 2009, at 16:03, B Maqueira wrote: I need to sort eficiently a large array (~9000) of SNMP OIDs. I am currently trying the following code: my @sorted_oids = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, pack

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Uri Guttman
> "RF" == Richard Foley writes: RF> Should that be a numerical sort via the spaceship operator? RF> <=> instead of cmp nope, since he is trying to compare a long string of the packed OIDs. you can't compare woth <=> anything other than normal integers or floats. uri -- Uri Guttman

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Uri Guttman
> "BM" == B Maqueira writes: BM> Dear all, BM> I need to sort eficiently a large array (~9000) of SNMP OIDs. BM> I am currently trying the following code: BM> my @sorted_oids = map { $_->[0] } BM> sort { $a->[1] cmp $b->[1] } BM>

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Richard Foley
Should that be a numerical sort via the spaceship operator? <=> instead of cmp -- Richard Foley Ciao - shorter than aufwiedersehen http://www.rfi.net/ On Saturday 31 October 2009 17:03:15 B Maqueira wrote: > Dear all, > > I need to sort eficiently a large array (~9000) of SNMP OIDs. >

Re: Efficient sorting of SNMP oids

2009-10-31 Thread Anton Berezin
On Sat, Oct 31, 2009 at 04:03:15PM +, B Maqueira wrote: > Dear all, > > I need to sort eficiently a large array (~9000) of SNMP OIDs. > > I am currently trying the following code: > > my @sorted_oids = map { $_->[0] } > sort { $a->[1] cmp $b->[1] } >

Efficient sorting of SNMP oids

2009-10-31 Thread B Maqueira
Dear all, I need to sort eficiently a large array (~9000) of SNMP OIDs. I am currently trying the following code: my @sorted_oids = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, pack('w*', split(/\./, $_))] } @oids