[aklug] Re: perl lists question, sorting, sort of.

From: Michael Fowler <michael@shoebox.net>
Date: Tue Aug 17 2010 - 16:36:33 AKDT

On Tue, Aug 17, 2010 at 04:26:49PM -0800, Arthur Corliss wrote:
> On Tue, 17 Aug 2010, Michael Fowler wrote:
>
>> inet_aton($a) cmp inet_aton($b) would be a simpler means of
>> accomplishing the sort, though both are going to choke on IPv6
>> addresses. What do you have against IPv6, Arthur?
>
> If you're going to go that route you should be using <=> not cmp. You're
> right, though, inet_aton is definitely shorter.

inet_aton does not return a number, it returns a packed string of four
bytes.

>> Also, /sm? You have joined the cargo cult!
>
> :-) I differ with Conway in several areas, but I can't fault his logic on
> the regex bit.

I don't know what that means; I have thus far avoided Perl Best
Practices. /sm on your regex is entirely superfluous, and indicates you
may have meant something else, which makes your intent unclear.

> <Sheesh> You get points for completeness, but at some point that really
> belongs in a script, not a one-liner! Man, I bet your history file is in
> MB... ;-) Good show!

An email is a file! I don't create one liners with line breaks. When
they get much past 300 characters I stop using the shell for it. I
simply tested it with copy and paste.

--
Michael Fowler
www.shoebox.net
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue Aug 17 16:38:32 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 16:38:32 AKDT