For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > June 2004 > Sorting an associative array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Sorting an associative array
Nathan Olson

2004-06-27, 3:56 pm

I've got an associative array whose keys are movie titles. I'd like to sort
the keys in an order that takes into account titles beginning with "A" or
"The." In other words, "The Graduate" ought to be sorted with the 'g's, not
the 't's. Is there any way to do this that doesn't involve sorting manually?


Thanks in advance,
Nate Olson

BZ

2004-06-27, 3:56 pm

Nathan Olson wrote in comp.lang.perl.misc:
> I've got an associative array whose keys are movie titles. I'd like to sort
> the keys in an order that takes into account titles beginning with "A" or
> "The." In other words, "The Graduate" ought to be sorted with the 'g's, not
> the 't's. Is there any way to do this that doesn't involve sorting manually?


Something like this should work:

sort {
$a =~ s/^(a|the)\s+//;
$b =~ s/^(a|the)\s+//;
$a <=> $b
} keys %hash;

--
BZ
John Bokma

2004-06-27, 3:56 pm

Nathan Olson wrote:

> I've got an associative array whose keys are movie titles. I'd like to sort
> the keys in an order that takes into account titles beginning with "A" or
> "The." In other words, "The Graduate" ought to be sorted with the 'g's, not
> the 't's. Is there any way to do this that doesn't involve sorting manually


create a look up table (array) consisting of arrays with the first
element the title, and the second one the title with "A " and "The " etc
removed. Sort it on the *second* element.

Next use the first element to index your assoc array.

Google for 'Schwartzian Transform' for some nice examples.
for example: http://www.stonehenge.com/merlyn/UnixReview/col06.html

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
John Bokma

2004-06-27, 3:56 pm

BZ wrote:

> Nathan Olson wrote in comp.lang.perl.misc:
>
>
> Something like this should work:
>
> sort {
> $a =~ s/^(a|the)\s+//;
> $b =~ s/^(a|the)\s+//;
> $a <=> $b
> } keys %hash;


Which does O(n log n) replacements. It might be faster to create a
look-up table, with O(n) replacements, and use that to sort.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Gunnar Hjalmarsson

2004-06-27, 3:56 pm

Nathan Olson wrote:
> I've got an associative array whose keys are movie titles. I'd like
> to sort the keys in an order that takes into account titles
> beginning with "A" or "The." In other words, "The Graduate" ought
> to be sorted with the 'g's, not the 't's.


my @sortedtitles = sort {
($a =~ /(?i:the|a)?\s*(.+)/)[0]
cmp
($b =~ /(?i:the|a)?\s*(.+)/)[0]
} keys %movies;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Gunnar Hjalmarsson

2004-06-27, 3:56 pm

Gunnar Hjalmarsson wrote:
>
> my @sortedtitles = sort {
> ($a =~ /(?i:the|a)?\s*(.+)/)[0]
> cmp
> ($b =~ /(?i:the|a)?\s*(.+)/)[0]
> } keys %movies;


Correction: Make that

my @sortedtitles = sort {
($a =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
cmp
($b =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
} keys %movies;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
John Bokma

2004-06-27, 3:56 pm



Gunnar Hjalmarsson wrote:

> Nathan Olson wrote:
>
>
>
> my @sortedtitles = sort {
> ($a =~ /(?i:the|a)?\s*(.+)/)[0]


This fails (?) with Thesomething and Asomething. Yeah, I know that the
specs said A and The., but you missed the dot after The too, so that's
not an excuse :-D

It also strips spaces in front of titles starting with spaces (ok there
probably are none like that)

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
John Bokma

2004-06-27, 3:56 pm

Gunnar Hjalmarsson wrote:

> Gunnar Hjalmarsson wrote:
>
>
> Correction: Make that
>
> my @sortedtitles = sort {
> ($a =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
> cmp
> ($b =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
> } keys %movies;


"Someone and the thingy"

(don't you need ^ ?)

And how to index %movies? I guess that the OP needs to access the info
in the %movies assoc.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Gunnar Hjalmarsson

2004-06-27, 3:56 pm

John Bokma wrote:
> Gunnar Hjalmarsson wrote:
>
> "Someone and the thingy"
>
> (don't you need ^ ?)


No. Unless a key starts with 'A ' or 'The ', (.+) captures the whole
key. (But ^ wouldn't have hurted, for the sake of clarity...)

> And how to index %movies? I guess that the OP needs to access the
> info in the %movies assoc.


Not sure what you mean. @sortedtitles can now be used to access the
info in %movies in the desired order.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Gunnar Hjalmarsson

2004-06-27, 3:56 pm

BZ wrote:
> Nathan Olson wrote in comp.lang.perl.misc:
>
> Something like this should work:
>
> sort {
> $a =~ s/^(a|the)\s+//;
> $b =~ s/^(a|the)\s+//;
> $a <=> $b
> } keys %hash;


Did you try it?

- It does not replace case insensitively.
- It sorts strings numerically.

Besides that, since all the elements in the returned list are no
longer an (exact) key in the hash, how would you use the list?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
John Bokma

2004-06-27, 3:56 pm

Gunnar Hjalmarsson wrote:
> John Bokma wrote:
>
>
> No. Unless a key starts with 'A ' or 'The ', (.+) captures the whole
> key. (But ^ wouldn't have hurted, for the sake of clarity...)


Ah, grmbl, indeed.

>
> Not sure what you mean. @sortedtitles can now be used to access the info
> in %movies in the desired order.


Indeed, my mistake again, it's a match :-(

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
John W. Krahn

2004-06-27, 3:56 pm

Nathan Olson wrote:
>
> I've got an associative array whose keys are movie titles. I'd like to sort
> the keys in an order that takes into account titles beginning with "A" or
> "The." In other words, "The Graduate" ought to be sorted with the 'g's, not
> the 't's. Is there any way to do this that doesn't involve sorting manually?


my @sorted_movie_titles =
map { s/^[^\0]+\0//; $_ }
sort
map { (my $x = $_) =~ s/^(?:a|the)\s*//i; "$x\0$_" }
keys %hash;



John
--
use Perl;
program
fulfillment
Gunnar Hjalmarsson

2004-06-27, 3:56 pm

John Bokma wrote:
>
> Ah, grmbl, indeed.


<snip>

> Indeed, my mistake again, it's a match :-(


Time to turn your attention from Purl Gurl to Perl?

(Sorry, couldn't resist.)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Gunnar Hjalmarsson

2004-06-27, 8:56 pm

John W. Krahn wrote:
>
> map { (my $x = $_) =~ s/^(?:a|the)\s*//i; "$x\0$_" }

------------------------------------------^

Seems as if you made a mistake similar to the one I made in my first post.

map { (my $x = $_) =~ s/^(?:a|the)\s+//i; "$x\0$_" }


--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
John Bokma

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> Time to turn your attention from Purl Gurl to Perl?
>
> (Sorry, couldn't resist.)


You're right. And breakfast first, before Usenet :-D

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> John Bokma wrote:


[color=darkred]
> Time to turn your attention from Purl Gurl to Perl?



I wish he would. He does need to learn Perl.

He is about the only one left harassing our family
on a daily basis. I have noted he has spent around
four to six hours today, probing our server trying
to find a way in.

Psychotic obsession is a type of mental disturbance.

Personally, I would much rather discuss Perl than to
spend my time trying to convince people here, criminally
harassing my family is wrong, is unlawful and will only
earn them legal difficulties.

I am a bit disturbed by the comment by one about placing
a bullet in my head. He and this person to whom you are
responding, are working together to harass our family.

We have, of course, turned his death threat over to an
appropriate law enforcement agency.

Wouldn't it be super if people in the Perl Community
would turn their attention away from committing crime
and back to discussions of Perl?

I doubt that will ever happen.

Incidently, if you check archives, you will discover this
question to which you are responding, has been asked many
times, all using "Movie" references or "Music" references,
over a number of years.

Sad. Recycling the same fabrications. Nonetheless, other
readers learn from your responses and others enjoy engaging
in discussions of Perl. There is benefit.

Perhaps he will take your advice. Highly doubtful considering
the type of psychosis he and others display.

Purl Gurl
John Bokma

2004-06-27, 8:56 pm

Purl Gurl wrote:

> Gunnar Hjalmarsson wrote:
>
>
>
>
> I wish he would. He does need to learn Perl.


True, every day I learn more and more Perl. Started 10 years ago, and
wish I had more time to study, now, and the past 10 years. That I stick
with it for 10 years is because there is so much to learn and the
language keeps amazing me.

> He is about the only one left harassing our family
> on a daily basis. I have noted he has spent around
> four to six hours today, probing our server trying
> to find a way in.


Funny, I am awake for a few hours, had breakfast, spend time with my
partner, and read a bit on the Usenet.

> Psychotic obsession is a type of mental disturbance.


You keep on proving to no zero about even the basics of
psychology/psychiatry.

> Personally, I would much rather discuss Perl


Then why don't you start learning this language?

> I am a bit disturbed


Yes, I think by now the entire Perl community is aware of that fact.

> Perhaps he will take your advice. Highly doubtful considering
> the type of psychosis he and others display.


Most people who suffer from psychosis are able to think correct and
valid within their reality, which is not that far removed from "reality"

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Purl Gurl

2004-06-27, 8:56 pm

John W. Krahn wrote:

> Nathan Olson wrote:


[color=darkred]
> my @sorted_movie_titles =
> map { s/^[^\0]+\0//; $_ }
> sort
> map { (my $x = $_) =~ s/^(?:a|the)\s*//i; "$x\0$_" }
> keys %hash;



I have been playing with your syntax.

Not knowing that many movie titles, I selected
literary work titles. Run this hash through
your syntax and see what you think.

$hash{"Anthem For Doomed Youth"} = 1;
$hash{"Ars Poetica"} = 1;
$hash{"The Sun Rising"} = 1;
$hash{"These Dreams"} = 1;


Purl Gurl
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> my @sortedtitles = sort {
> ($a =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
> cmp
> ($b =~ /(?:(?i:the|a)\s+)?(.+)/)[0]
> } keys %movies;
>



à beintôt will give you fits, but hardly a point of critque.

Both Perl 5.6 and Perl 5.8 choke on accented characters
on my system.

Nonetheless, for standard characters your sorting works nice.
You would not expect input of accented characters, unless
a foreign film title came in.


Purl Gurl
John W. Krahn

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:
>
> John W. Krahn wrote:
> ------------------------------------------^
>
> Seems as if you made a mistake similar to the one I made in my first post.
>
> map { (my $x = $_) =~ s/^(?:a|the)\s+//i; "$x\0$_" }


Ah yes, thanks.


John
--
use Perl;
program
fulfillment
Gunnar Hjalmarsson

2004-06-27, 8:56 pm

Purl Gurl wrote:
> Gunnar Hjalmarsson wrote:
>
> à beintôt will give you fits, but hardly a point of critque.
>
> Both Perl 5.6 and Perl 5.8 choke on accented characters
> on my system.


What?? Are you implying that not all movies are made in the US and
have all American titles? ;-)

Assuming that you are right about that, what exactly do you mean by
"choke"? I notice that "use locale;" makes a difference on my box with
respect to the sort order (I'm Swedish, so it probably turns on a
Swedish locale), but I don't get any errors or warnings.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:
[color=darkred]
[color=darkred]
[color=darkred]
> What?? Are you implying that not all movies are made in the US and
> have all American titles? ;-)


Actually, Hollywood produces very few films in "Hollywood."

Hollywood has moved overseas to avoid taxation and to enjoy
classic "Nike" five cents per hour wages. Governor Terminator
is working on this. When he speaks, politicians cringe.


> Assuming that you are right


I am always right.

> what exactly do you mean by "choke"?


That is what I would like to do to some here.

Returned sort order is wrong for accented characters.
This is assuming "a" and "à" should be grouped together,
but which should be first, is a "who's on first" question.

On my system, à beintôt always is in last position.
Not surprising, being a French expression; they are
known for quickly surrendering their position.

Of interest, in many dictionaries, next word
after à beintôt is abigail.

Some might enjoy learning the definition of abigail.

You might think I chose à beintôt with intent, yes?

Purl Gurl
Gunnar Hjalmarsson

2004-06-27, 8:56 pm

Purl Gurl wrote:
> I am always right.


Sorry, forgot that.

> Returned sort order is wrong for accented characters. This is
> assuming "a" and "à" should be grouped together, but which should
> be first, is a "who's on first" question.


Then it has nothing to do with the sorting code and it has everything
to do with locales. Choose a suitable locale, and you're done.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Purl Gurl

2004-06-27, 8:56 pm

Purl Gurl wrote:

> Gunnar Hjalmarsson wrote:
[color=darkred]
[color=darkred]
[color=darkred]
> Returned sort order is wrong for accented characters.
> This is assuming "a" and "à" should be grouped together,
> but which should be first, is a "who's on first" question.


When sorted by decimal value, "à" is 133 and "ô" is 147.
Clearly both are in the high ASCII grouping.

Haven't tested this yet with Perl, but in the grouping,

à
a
àb
ab
b
bc

I believe à and àb will fall in last position. Not
sure which will be last. Suppose I could test.

a ab b bc à àb

That is the sort order returned on my system.


Purl Gurl
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:


[color=darkred]
> Then it has nothing to do with the sorting code and it has everything
> to do with locales. Choose a suitable locale, and you're done.


Is there a locale for California Bimboese?


Purl Gurl
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:


[color=darkred]
> Then it has nothing to do with the sorting code and it has everything
> to do with locales. Choose a suitable locale, and you're done.



Ah, but there is still the question of which is correct grouping.

Strikes me a and à should be grouped together at the
beginning of a sort list. Which should be first, I do not
have a clue. I suppose for you, à should be before a in
a list. Maybe second because à is a more busy letter?

Does your locale group those two together?


Purl Gurl
Gunnar Hjalmarsson

2004-06-27, 8:56 pm

Purl Gurl wrote:
> Strikes me a and à should be grouped together at the beginning
> of a sort list. Which should be first, I do not have a clue. I
> suppose for you, à should be before a in a list. Maybe second
> because à is a more busy letter?


Actually, 'à' is not part of the Swedish alphabet (we have å, ä and ö
besides the ASCII letters), but intuitively I'd say that 'a' should
come first.

> Does your locale group those two together?


Yes.

Playing with the list you posted in another message:

$, = ' ';
print sort qw(a ab b bc à àb);

does not change the order, which is as expected since Perl ignores all
locales by default. But

use locale;
$, = ' ';
print sort qw(a ab b bc à àb);

outputs:
a à ab àb b bc

on my box.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Purl Gurl

2004-06-27, 8:56 pm

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:


> Actually, 'à' is not part of the Swedish alphabet (we have å, ä and ö
> besides the ASCII letters), but intuitively I'd say that 'a' should
> come first.


[color=darkred]
> Playing with the list you posted in another message:


> $, = ' ';
> print sort qw(a ab b bc à àb);


> does not change the order, which is as expected since Perl ignores all
> locales by default. But


> use locale;
> $, = ' ';
> print sort qw(a ab b bc à àb);


> outputs:


> a à ab àb b bc


Exactly what I would expect as well. Thanks, saves me the time
and effort setting up for locales; typing an extra line is
abusive on my fat fingers.

Yes, I attain the same results with use locale syntax.

However, MSDOS prints out very cute little characters,
but not those. Same order as your results, though.

Running your code as a cgi application and using an 8 bit
browser, prints the correct characters.

So, sorting words, whether it be names, titles, movies, poems,
whatever, will be highly locale dependent.

You and I know, this has been discussed eighty-bagillion times
here, but this does seem a good time to refresh a locales topic
for readers who are new to this oddity.


> on my box.


Oh, I thought you were male.


Thanks for running a locales test and providing results.
Kinda fun to find weird stuff which breaks your code.

Purl Gurl
Gunnar Hjalmarsson

2004-06-27, 8:56 pm

Purl Gurl wrote:
> Gunnar Hjalmarsson wrote:
>
> Yes, I attain the same results with use locale syntax.
>
> However, MSDOS prints out very cute little characters, but not
> those. Same order as your results, though.
>
> Running your code as a cgi application and using an 8 bit browser,
> prints the correct characters.


I do that all the time when playing with code snippets on W98. MSDOS
does not make anybody happy...

> ... this does seem a good time to refresh a locales topic for
> readers who are new to this oddity.


Oddity??? In my country, like in most parts of the world, it's not an
oddity at all. From a global perspective, an alphabet limited to the
ASCII letters is the oddity!

>
> Oh, I thought you were male.


??
( Not sure I want to hear the explanation, though. ;-) )

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Purl Gurl

2004-06-28, 3:56 am

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:

(snipped)
[color=darkred]
[color=darkred]
[color=darkred]
[color=darkred]
> I do that all the time when playing with code snippets on W98. MSDOS
> does not make anybody happy...


MSDOS makes me very happy! I use DOS style programming a lot.
Our Androids are partially based upon DOS batch files and
compiled C executables for DOS. Many of the tricks and features
my "artificial intelligence" programs display, exists only
because of DOS programming.

I have played around many times with loading ansi.sys, with
loading various codepage files. Playing with ansi.sys is
fun, allowing you to write DOS screen savers, create password
logon to DOS, very colorful stuff. Contrasting this, codepage
files for different character sets, those are a royal pain.
Not worth the effort as a work-around for "locale" with Perl.

Ironically, working with DOS is a lot easier on Win3.x machines.
Very nice blend of DOS and Win GUI programming. Cannot do much
of anything else, but a very powerful system which affords many
features not found with Win9.x and never found with NT5.


[color=darkred]
> Oddity??? In my country, like in most parts of the world, it's not an
> oddity at all. From a global perspective, an alphabet limited to the
> ASCII letters is the oddity!


There are other countries besides America? What an oddity.


Nice conversation, Gunnar. Had a nice conversation with Tassilo
a few days back as well. Wish I could enjoy more nice conversations
like the two of you have provided. Thank you.


Purl Gurl
Gunnar Hjalmarsson

2004-06-28, 3:56 am

Purl Gurl wrote:
> Nice conversation, Gunnar.


Yeah. And on topic, mostly.

> Had a nice conversation with Tassilo a few days back as well. Wish
> I could enjoy more nice conversations like the two of you have
> provided.


I'm sure you can. It hinges on you.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
DominiX

2004-06-28, 3:56 am

ici même:40DF5775.CEBB554D@purlgurl.net,
Purl Gurl <purlgurl@purlgurl.net> a écrit
> Gunnar Hjalmarsson wrote:
>
>
>

....
>
> I am always right.
>

....
> On my system, à beintôt always is in last position.
> Not surprising, being a French expression;


so you're no more right, "à beintôt" is not french.
"à bientôt" is.

> they are known for quickly surrendering their position.


what do mean ?
do you plan a 200+ messages thread to pretent that you were
right with your knowledge of French ?
you're pathetic. End of discution miss wrong.

--
dominix


Purl Gurl

2004-06-28, 3:56 am

Gunnar Hjalmarsson wrote:

> Purl Gurl wrote:
[color=darkred]
> Yeah. And on topic, mostly.


[color=darkred]
> I'm sure you can. It hinges on you.


I see. So your behavior is not a factor?


Purl Gurl
John Bokma

2004-06-28, 3:56 am

Purl Gurl wrote:

> I am always right.


Sure.

> Returned sort order is wrong for accented characters.
> This is assuming "a" and "à" should be grouped together,


Yeah, and I guess it's wrong for Devanagari too.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Gunnar Hjalmarsson

2004-06-28, 3:56 am

Purl Gurl wrote:
> Gunnar Hjalmarsson wrote:
>
> I see. So your behavior is not a factor?


Heard of the Golden Rule? If not, Google for it. ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Sherm Pendley

2004-06-28, 4:09 pm

Purl Gurl wrote:

> Nice conversation, Gunnar. Had a nice conversation with Tassilo
> a few days back as well. Wish I could enjoy more nice conversations
> like the two of you have provided. Thank you.


In this thread you were polite and on-topic, and Gunnar responded in the
same way. In other threads you rant, insult, and make outlandish
accusations - and others respond in the same way.

You reap what you sow.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Purl Gurl

2004-06-28, 4:09 pm

Sherm Pendley wrote:

> Purl Gurl wrote:


[color=darkred]
> In this thread you were polite and on-topic, and Gunnar responded in the
> same way. In other threads you rant, insult, and make outlandish
> accusations - and others respond in the same way.


You boys have been ranting this same worn-out claim for years,

"It is never our fault. It is always your fault."

This group is nothing but a Cluster F'k.


Purl Gurl
Sherm Pendley

2004-06-28, 4:09 pm

Purl Gurl wrote:

> You boys have been ranting this same worn-out claim for years,


Indeed - philosophers have discussed the principle of the "golden rule" in
many variations for thousands of years. It's a time-honored concept.

> "It is never our fault. It is always your fault."


That's not what I said. All I'm saying is, you were polite and courteous
here in this thread, and Gunnar responded to that with polite comments of
his own. In other threads you act differently, and get different sorts of
responses.

I am *not* trying to excuse any sort of criminal behavior. That sort of
thing - if it's really happening - is certainly not justified by any of
comments, either rude or polite, you've made here.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Purl Gurl

2004-06-28, 4:09 pm

Sherm Pendley wrote:

> Purl Gurl wrote:


(snipped)

[color=darkred]
[color=darkred]
> That's not what I said. All I'm saying is,


Being the Goddess of this group, this time I will
allow you to have the last word. This is a good
practice when working with male subjects.


Purl Gurl
Kevin Collins

2004-06-28, 8:58 pm

In article <40DF2C73.A37F77E6@purlgurl.net>, Purl Gurl wrote:
> Gunnar Hjalmarsson wrote:
>
>
>
>
>
> I wish he would. He does need to learn Perl.
>
> He is about the only one left harassing our family
> on a daily basis. I have noted he has spent around
> four to six hours today, probing our server trying
> to find a way in.
>
> Psychotic obsession is a type of mental disturbance.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^

So far, I have resisted the urge to make any responses to your posts. However,
on this occasion, I have one simple statement regarding the above sentence:

Pot? Kettle? Black!

> Personally, I would much rather discuss Perl than to
> spend my time trying to convince people here, criminally
> harassing my family is wrong, is unlawful and will only
> earn them legal difficulties.
>
> I am a bit disturbed by the comment by one about placing
> a bullet in my head. He and this person to whom you are
> responding, are working together to harass our family.
>
> We have, of course, turned his death threat over to an
> appropriate law enforcement agency.
>
> Wouldn't it be super if people in the Perl Community
> would turn their attention away from committing crime
> and back to discussions of Perl?
>
> I doubt that will ever happen.
>
> Incidently, if you check archives, you will discover this
> question to which you are responding, has been asked many
> times, all using "Movie" references or "Music" references,
> over a number of years.
>
> Sad. Recycling the same fabrications. Nonetheless, other
> readers learn from your responses and others enjoy engaging
> in discussions of Perl. There is benefit.
>
> Perhaps he will take your advice. Highly doubtful considering
> the type of psychosis he and others display.
>
> Purl Gurl

Purl Gurl

2004-06-28, 8:58 pm

Kevin Collins wrote:

> Purl Gurl wrote:
[color=darkred]
> So far, I have resisted the urge to make any responses to your posts.


Resistance is futile. You will be assimilated.

Borg Gurl
Abigail

2004-06-29, 8:56 am

Nathan Olson (nolson66@comcast.net) wrote on MMMCMLIII September MCMXCIII
in <URL:news:BD044B8D.1397A%nolson66@comcast.net>:
?? I've got an associative array whose keys are movie titles. I'd like to sort
?? the keys in an order that takes into account titles beginning with "A" or
?? "The." In other words, "The Graduate" ought to be sorted with the 'g's, not
?? the 't's. Is there any way to do this that doesn't involve sorting manually?


Assuming no movie title contains a "\0" character (untested):

my @sorted = map {s/(.*)\0(.*)/$2$1/s; $_}
sort
map {s/^((?:An?|The)\s+)(.*)/$2\0$1/s; $_}
keys %movies;


Abigail
--
CHECK {print "another "}
INIT {print "Perl " }
END {print "Hacker\n"}
BEGIN {print "Just " }
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com