[23791] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5994 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 18:12:53 2004

Date: Thu, 29 Jan 2004 15:12:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 29 Jan 2004     Volume: 10 Number: 5994

Today's topics:
    Re: $$$ Im at a loss for words THIS WORKS $$$ <tore@aursand.no>
    Re: $$$ Im at a loss for words THIS WORKS $$$ <bernard.el-haginDODGE_THIS@lido-tech.net>
    Re: $$$ Im at a loss for words THIS WORKS $$$ <obeseted@yahoo.com>
    Re: $$$ Im at a loss for words THIS WORKS $$$ <matthew.garrish@sympatico.ca>
    Re: $$$ Im at a loss for words THIS WORKS $$$ (Malcolm Dew-Jones)
    Re: $$$ Im at a loss for words THIS WORKS $$$ <matthew.garrish@sympatico.ca>
    Re: $$$ Im at a loss for words THIS WORKS $$$ (Malcolm Dew-Jones)
    Re: $$$ Im at a loss for words THIS WORKS $$$ <matthew.garrish@sympatico.ca>
        $$$$$ Looking for a career change? Great Pay??? Work fr <.awozddu@yavnxddt.com>
        'by package' sorting of fully qualified functions <tassilo.parseval@rwth-aachen.de>
    Re: 'by package' sorting of fully qualified functions (Anno Siegel)
    Re: 'by package' sorting of fully qualified functions <usenet@morrow.me.uk>
    Re: 'by package' sorting of fully qualified functions <tassilo.parseval@rwth-aachen.de>
    Re: 'by package' sorting of fully qualified functions <tassilo.parseval@rwth-aachen.de>
    Re: 'by package' sorting of fully qualified functions <blgl@hagernas.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 22 Jan 2004 19:34:46 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <pan.2004.01.22.18.25.07.595068@aursand.no>

On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
>> Some spammer wrote in comp.lang.perl.misc:
>> 
>> [200 lines]

> But I never saw it. My scorefile did its job yet again.
> [...]

Congratulations.  You must be proud?  What does your scorefile have to do
with Perl?


-- 
Tore Aursand <tore@aursand.no>
"Life is pleasant. Death is peaceful. It's the transition that's
 troublesome." -- Isaac Asimov


------------------------------

Date: Fri, 23 Jan 2004 09:16:17 +0100
From: Bernard El-Hagin <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <slrnc11ltk.ne.bernard.el-haginDODGE_THIS@gdndev25.lido-tech>

On 2004-01-22, Tore Aursand <tore@aursand.no> wrote:
> On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
>>> Some spammer wrote in comp.lang.perl.misc:
>>> 
>>> [200 lines]
>
>> But I never saw it. My scorefile did its job yet again.
>> [...]
>
> Congratulations.  You must be proud?  What does your scorefile have to do
> with Perl?


As much as your follow-up.


At least Tad's OT post was useful (can you say "copy and paste"?) whereas
yours is not only useless, it's unnecessarily belligerent as well.


-- 
Cheers,
Bernard


------------------------------

Date: Fri, 23 Jan 2004 12:11:45 +0100
From: "Fatted" <obeseted@yahoo.com>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <buqvjt$l3at6$1@ID-216008.news.uni-berlin.de>

"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in
message news:slrnc11ltk.ne.bernard.el-haginDODGE_THIS@gdndev25.lido-tech...
> On 2004-01-22, Tore Aursand <tore@aursand.no> wrote:
> > On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
> >>> Some spammer wrote in comp.lang.perl.misc:
> >>>
> >>> [200 lines]
> >
> >> But I never saw it. My scorefile did its job yet again.
> >> [...]
> >
> > Congratulations.  You must be proud?  What does your scorefile have to
do
> > with Perl?
>
>
> As much as your follow-up.
>
>
> At least Tad's OT post was useful (can you say "copy and paste"?) whereas
> yours is not only useless, it's unnecessarily belligerent as well.

I'm sensing an infinite loop coming on :)




------------------------------

Date: Fri, 23 Jan 2004 16:10:47 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <o5gQb.6822$rW5.674424@news20.bellglobal.com>


"Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net> wrote in
message news:slrnc11ltk.ne.bernard.el-haginDODGE_THIS@gdndev25.lido-tech...
> On 2004-01-22, Tore Aursand <tore@aursand.no> wrote:
> > On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
> >>> Some spammer wrote in comp.lang.perl.misc:
> >>>
> >>> [200 lines]
> >
> >> But I never saw it. My scorefile did its job yet again.
> >> [...]
> >
> > Congratulations.  You must be proud?  What does your scorefile have to
do
> > with Perl?
>
>
> As much as your follow-up.
>

As much as your follow-up.

As much as my follow-up.

Live by the sword; die by the sword. Tad likes to point out pointless posts,
so eventually it had to come back and nip him in the bud...

Matt




------------------------------

Date: 23 Jan 2004 13:57:41 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <401198d5@news.victoria.tc.ca>

Tore Aursand (tore@aursand.no) wrote:
: On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
: >> Some spammer wrote in comp.lang.perl.misc:
: >> 
: >> [200 lines]

: > But I never saw it. My scorefile did its job yet again.
: > [...]

: Congratulations.  You must be proud?  What does your scorefile have to do
: with Perl?

If it splits posts into perl related and non-perl related then it seems 
to be a suitable candidate for perl misc discussion.


------------------------------

Date: Fri, 23 Jan 2004 17:15:10 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <K1hQb.20085$U77.1723303@news20.bellglobal.com>


"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:401198d5@news.victoria.tc.ca...
> Tore Aursand (tore@aursand.no) wrote:
> : On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
> : >> Some spammer wrote in comp.lang.perl.misc:
> : >>
> : >> [200 lines]
>
> : > But I never saw it. My scorefile did its job yet again.
> : > [...]
>
> : Congratulations.  You must be proud?  What does your scorefile have to
do
> : with Perl?
>
> If it splits posts into perl related and non-perl related then it seems
> to be a suitable candidate for perl misc discussion.

When did this become a newsgroup about configuring your newsreader to filter
email? You can't make exceptions just because someone has been around a long
time. Randal's module posting was more on-topic, and he got flamed...

Matt

Matt




------------------------------

Date: 23 Jan 2004 15:02:33 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <4011a809@news.victoria.tc.ca>

Matt Garrish (matthew.garrish@sympatico.ca) wrote:

: "Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
: news:401198d5@news.victoria.tc.ca...
: > Tore Aursand (tore@aursand.no) wrote:
: > : On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
: > : >> Some spammer wrote in comp.lang.perl.misc:
: > : >>
: > : >> [200 lines]
: >
: > : > But I never saw it. My scorefile did its job yet again.
: > : > [...]
: >
: > : Congratulations.  You must be proud?  What does your scorefile have to
: do
: > : with Perl?
: >
: > If it splits posts into perl related and non-perl related then it seems
: > to be a suitable candidate for perl misc discussion.

: When did this become a newsgroup about configuring your newsreader to filter
: email? 

It's a newsgroup about perl related topics.

Discussing the detection of perl related topics appears to be a perl
related topic.  

If he posted this in most other newsgroups then it wouldn't be of interest
to the readers.  If this was posted in a newsreader group then it wouldn't
be of interest to the majority of the readers since (I assume) they have
no particular interest in perl, and the scorefile certainly doesn't shed
any particular new light on how to how best to use your newsreader in any 
other situation.

: You can't make exceptions just because someone has been around a long
: time. 

I didn't.



------------------------------

Date: Fri, 23 Jan 2004 18:48:00 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: $$$ Im at a loss for words THIS WORKS $$$
Message-Id: <NoiQb.20134$U77.1751924@news20.bellglobal.com>


"Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
news:4011a809@news.victoria.tc.ca...
> Matt Garrish (matthew.garrish@sympatico.ca) wrote:
>
> : "Malcolm Dew-Jones" <yf110@vtn1.victoria.tc.ca> wrote in message
> : news:401198d5@news.victoria.tc.ca...
> : > Tore Aursand (tore@aursand.no) wrote:
> : > : On Thu, 22 Jan 2004 08:02:00 -0600, Tad McClellan wrote:
> : > : >> Some spammer wrote in comp.lang.perl.misc:
> : > : >>
> : > : >> [200 lines]
> : >
> : > : > But I never saw it. My scorefile did its job yet again.
> : > : > [...]
> : >
> : > : Congratulations.  You must be proud?  What does your scorefile have
to
> : do
> : > : with Perl?
> : >
> : > If it splits posts into perl related and non-perl related then it
seems
> : > to be a suitable candidate for perl misc discussion.
>
> : When did this become a newsgroup about configuring your newsreader to
filter
> : email?
>
> It's a newsgroup about perl related topics.
>
> Discussing the detection of perl related topics appears to be a perl
> related topic.
>

Yes, it *appears* to be on-topic, but isn't. It is about how he configures
his newsreader. I don't use his newsreader, neither does Tore, hence we
don't care.. Or do you think it would be useful for everyone who keeps a
killfile or scorefile to start posting them here?

Matt




------------------------------

Date: Tue, 27 Jan 2004 22:37:32 -0700
From: "Believer" <.awozddu@yavnxddt.com>
Subject: $$$$$ Looking for a career change? Great Pay??? Work from Home? $$$
Message-Id: <zhIRb.1768$dw4.154002@news.uswest.net>

This is a multi-part message in MIME format

--=_NextPart_2rfkindysadvnqw3nerasdf
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

               MAKE MONEY!!!


MAKE THOUSANDS!!!

I found this on a bulletin board and decided to try it: I don't care about the useless pre-fabricated crap this message usually says. All I say is, it works. Continue pre-fab crap.

WELL GUESS WHAT!!!

Within seven days, I started getting money in the mail!! I
was shocked!! I figured it would end soon, but the money just kept
coming in. In my first week, I made about $25.00. By the end of the second week I had
made a total of more than $1000.00!! In the third week I had more than
$10,000.00 and it's still growing!! This is now my fourth week and I have made a total of $42,000.00 and it's still coming rapidly. It's certainly worth $6.00 and six stamps, and I have spent more than that on the lottery without ever  winning!!!

Let me tell you how this works and most important, why it works..........
also make sure you print this out NOW, so you can get the information off of it, as you will need it. I promise you that if you follow the directions exactly that you
will start making more money than you thought possible by doing something so easy!!

Suggestion: Read this entire message carefully!! (Print it out or download it)

Follow the simple directions and watch the money come in!! It's easy.
It's legal. And, your investment is only $6.00 (Plus postage) !!!

IMPORTANT:

This is not a rip-off, it is decent; it's legal; and it is virtually no risk - it really works!! If all the following instructions are adhered to, you will receive extraordinary dividends.

PLEASE NOTE:

Please follow the directions EXACTLY, and $50,000 or more can be yours
in 20 to 60 days. This program remains successful because of the honesty and
integrity of the participants. Please continue its success by carefully adhering to
the instructions. You will now become apart of the Mail Order business. You
are in the business of developing Mailing Lists. Many large corporations are
happy to pay big bucks for quality lists. However, the money made from the
mailing lists is secondary to income which is made from people like you and me asking to be included in that list. Here are the four easy steps to success.

STEP ONE:

Get six separate pieces of paper and write the following on
each piece of paper "PLEASE PUT ME ON YOUR MAILING LIST."
Now get 6 U.S. $1.00 bills and place ONE inside of EACH of the six pieces of paper so the bill will not be seen through the envelope (to prevent thievery). Next, place one paper in each of the six envelopes and seal them. You now should have six sealed envelopes, each with a piece of paper stating the above phrase, your name and address, and a $1.00 bill. What you are doing is creating a service.

THIS IS ABSOLUTELY LEGAL!!!!!

You are requesting a legitimate service and you are paying for it!! Like
most of us I was a little skeptical and little worried about the legal aspects
of it all. So I checked it out with the U.S. Post Office (1-800-238-5355) and they
confirmed that it is indeed legal!!

Mail the six envelopes to the following addresses:

J.J. Maxey
355 N. Manila Ave.
Fresno, CA 93727
USA

Kyle Pate
P.o. Box 2046
Great Falls, MT 59403-2046
USA

G.H.L.
1600 N Thorntree Rd
Muncie, IN  47304-9710
USA

G. Skillen
32 Ebor Drive
Tates Avenue
Belfast, BT12 6NR
Northern Ireland


M. Motut
2377 Anora Dr.
Abbotsford, BC v2s 5p3
Canada


T. Wallace
8915 E. Carlton Ave.
Mesa, AZ 85208-2399
USA





STEP TWO:Now take the #1 name off the list that you see above, move the other names up (six becomes 5, 5 becomes 4, and etc.) and add YOUR NAME as number 6 on the list.

STEP THREE:
Change anything you need to but try to keep this article as close to original as possible. Now post your amended article to at least 200 news groups. :
(I think there are close to 24,000 groups) All you need is 200, but remember, the more you post, the more money you make!! This is perfectly legal!! If you have any doubts, refer to Title 18 Sec. 1302 & 1341 of the Postal Lottery laws. Keep a copy of these steps for yourself and whenever you need money, you can use it again, and again. PLEASE REMEMBER that this program remains successful because of the honesty and integrity of the participants and by their carefully adhering to directions. Look at it this way. If you were of integrity, the program will continue and the money that so many others have received will come your way.

NOTE: You may want to retain every name and address sent to you,
either on a computer or hard copy and keep the notes people send you.
This VERIFIES that you are truly providing a service.  (Also, it might be a good idea to wrap the $1 bill in dark paper to reduce the risk of mail theft). So, as each post is downloaded and the directions carefully followed, all members will be reimbursed for their participation as a List Developer  with one dollar each. Your name will move up the list geometrically so that when your name reaches the #1 position you will be receiving thousands of dollars in CASH!!! What an opportunity for only $6.00 ( $1.00 for each of the first six people listed above) Send it now, add your own name to the list and you're in business!!!


*****DIRECTIONS FOR HOW TO POST TO NEWS GROUPS!!!*****

STEP ONE: You do not need to re-type this entire letter to do your own
posting. Simply put your cursor at the beginning of this letter and drag your
cursor to the bottom of this document, and select 'copy' from the edit menu. This
will copy the entire letter into the computer's memory.

STEP TWO:
Open a blank 'notepad' file and place your cursor at the top
of the blank page. From the 'edit' menu select 'paste'. This will paste a copy
of the letter into the notepad so that you will add your name to the list.

STEP THREE:
Save your new notepad file as a text file. If you want to do your posting in different settings, you'll always have this file to go back to.

STEP FOUR:
You can use a program like "postXpert" to post to all the newsgroups at once.
You can find this program at  <http://www.download.com>.

Use Netscape or Internet Explorer and try searching for various new
groups (on- line forums, message boards, chat sites, discussions.)

STEP FIVE:
Visit message boards and post this article as a new message by highlighting the text of this letter and selecting paste from the edit menu. Fill in the subject, this will be the header that everyone sees as they scroll through the list of postings in a particular group, click the post message button. You're done.

Congratulations!!!!!!

THAT'S IT!! All you have to do, and It Really works!!!

Best Wishes















--=_NextPart_2rfkindysadvnqw3nerasdf
Content-Type: application/octet-stream;
        name="MoneyMaker1c_out.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
        filename="MoneyMaker1c_out.txt"

ICAgICAgICAgICAgICAgTUFLRSBNT05FWSEhIQ0KDQoNCk1BS0UgVEhPVVNBTkRTISEhDQoNCkkg
Zm91bmQgdGhpcyBvbiBhIGJ1bGxldGluIGJvYXJkIGFuZCBkZWNpZGVkIHRvIHRyeSBpdDogSSBk
b24ndCBjYXJlIGFib3V0IHRoZSB1c2VsZXNzIHByZS1mYWJyaWNhdGVkIGNyYXAgdGhpcyBtZXNz
YWdlIHVzdWFsbHkgc2F5cy4gQWxsIEkgc2F5IGlzLCBpdCB3b3Jrcy4gQ29udGludWUgcHJlLWZh
YiBjcmFwLg0KDQpXRUxMIEdVRVNTIFdIQVQhISENCg0KV2l0aGluIHNldmVuIGRheXMsIEkgc3Rh
cnRlZCBnZXR0aW5nIG1vbmV5IGluIHRoZSBtYWlsISEgSQ0Kd2FzIHNob2NrZWQhISBJIGZpZ3Vy
ZWQgaXQgd291bGQgZW5kIHNvb24sIGJ1dCB0aGUgbW9uZXkganVzdCBrZXB0DQpjb21pbmcgaW4u
IEluIG15IGZpcnN0IHdlZWssIEkgbWFkZSBhYm91dCAkMjUuMDAuIEJ5IHRoZSBlbmQgb2YgdGhl
IHNlY29uZCB3ZWVrIEkgaGFkDQptYWRlIGEgdG90YWwgb2YgbW9yZSB0aGFuICQxMDAwLjAwISEg
SW4gdGhlIHRoaXJkIHdlZWsgSSBoYWQgbW9yZSB0aGFuDQokMTAsMDAwLjAwIGFuZCBpdCdzIHN0
aWxsIGdyb3dpbmchISBUaGlzIGl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byBhbGwg
dGhlIG5ld3Nncm91cHMgYXQgb25jZS4NCllvdSBjYW4gZmluZCB0aGlzIHByb2dyYW0gYXQgIDxo
dHRwOi8vd3d3LmRvd25sb2FkLmNvbT4uDQoNClVzZSBOZXRzY2FwZSBvciBJbnRlcm5ldCBFeHBs
b3JlciBhbmQgdHJ5IHNlYXJjaGluZyBmb3IgdmFyaW91cyBuZXcNCmdyb3VwcyAob24tIGxpbmUg
Zm9ydW1zLCBtZXNzYWdlIGJvYXJkcywgY2hhdCBzaXRlcywgZGlzY3Vzc2lvbnMuKQ0KDQpTVEVQ
IEZJVkU6DQpWaXNpdCBtZXNzYWdlIGJvYXJkcyBhbmQgcG9zdCB0aGlzIGFydGljbGUgYXMgYSBu
ZXcgbWVzc2FnZSBieSBoaWdobGlnaHRpbmcgdGhlIHRleHQgb2YgdGhpcyBsZXR0ZXIgYW5kIHNl
bGVjdGluZyBwYXN0ZSBmcm9tIHRoZSBlZGl0IG1lbnUuIEZpbGwgaW4gdGhlIHN1YmplY3QsIHRo
aXMgd2lsbCBiZSB0aGUgaGVhZGVyIHRoYXQgZXZlcnlvbmUgc2VlcyBhcyB0aGV5IHNjcm9sbCB0
aHJvdWdoIHRoZSBsaXN0IG9mIHBvc3RpbmdzIGluIGEgcGFydGljdWxhciBncm91cCwgY2xpY2sg
dGhlIHBvc3QgbWVzc2FnZSBidXR0b24uIFlvdSdyZSBkb25lLg0KDQpDb25ncmF0dWxhdGlvbnMh
ISEhISENCg0KVEhBVCdTIElUISEgQWxsIHlvdSBoYXZlIHRvIGRvLCBhbmQgSXQgUmVhbGx5IHdv
cmtzISEhDQoNCkJlc3QgV2lzaGVzDQoNCg0KDQoNCg0KDQoNCg0KDQo=

--=_NextPart_2rfkindysadvnqw3nerasdf--


------------------------------

Date: 29 Jan 2004 09:35:39 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: 'by package' sorting of fully qualified functions
Message-Id: <bvak5b$fo4$1@nets3.rz.RWTH-Aachen.DE>

Hi there,

I was in the situation to come up with a kind of special sort routine.
The data to be sorted is a list of fully qualified function names as in

    Pack1::subpack::func2
    Pack1::subpack::func1
    Pack1::func
    __MAIN__
    Pack2::bla
    Pack1::subpack::another_subpack::func

which ultimately should be sorted like this:

    Pack1::func
    Pack1::subpack::func1
    Pack1::subpack::func2
    Pack1::subpack::another_subpack::func
    Pack2::bla
    __MAIN__

So essentially this should order these functions hierarchicly on their
package name and finally on their function name. '__MAIN__' should
always come as last element.

I had a hard time getting it right for a seemingly simple problem such
as this one. My solution:

    @sorted = sort bypackage @functions;
    
    sub bypackage {
       
        # make sure that __MAIN__ is always last on output
        return  1 if $a eq '__MAIN__';
        return -1 if $b eq '__MAIN__';

        my @a = split /::/, $a;
        my @b = split /::/, $b;
        
        my $s = '$a[0] cmp $b[0]';
        if (@a == @b) {
            $s .= "||\$a[$_] cmp \$b[$_]" for 1 .. $#a;
        } else {
            my $min = @a < @b ? $#a : $#b;
            $s = '$a[0] cmp $b[0]';
            $s .= "||\$a[$_] cmp \$b[$_]" for 1 .. $min-1;
            $s .= "||\@a <=> \@b";
        }
        return eval $s;
    }

I am not so much concerned with the dog-like slowness of the above. That
can be tolerated (the splits could be be cached to improve it a little).
I think the wordiness doesn't make this a very elegant solution measured
by Perl-standards.

How would others solve this task?
    
Bonus question: if speed was an issue, how could techniques such as
the Schwartzian or Guttman-Rosler Transform be applied here?

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: 29 Jan 2004 10:45:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: 'by package' sorting of fully qualified functions
Message-Id: <bvao8n$s1v$1@mamenchi.zrz.TU-Berlin.DE>

Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
> Hi there,
> 
> I was in the situation to come up with a kind of special sort routine.
> The data to be sorted is a list of fully qualified function names as in
> 
>     Pack1::subpack::func2
>     Pack1::subpack::func1
>     Pack1::func
>     __MAIN__
>     Pack2::bla
>     Pack1::subpack::another_subpack::func
> 
> which ultimately should be sorted like this:
> 
>     Pack1::func
>     Pack1::subpack::func1
>     Pack1::subpack::func2
>     Pack1::subpack::another_subpack::func
>     Pack2::bla
>     __MAIN__
> 
> So essentially this should order these functions hierarchicly on their
> package name and finally on their function name. '__MAIN__' should
> always come as last element.

That last requirement will have to be dealt with in an ad-hoc manner.
Also, "__MAIN__" isn't a fully qualified function name.  I'll ignore
it for now.

> I had a hard time getting it right for a seemingly simple problem such
> as this one. My solution:
> 
>     @sorted = sort bypackage @functions;
>     
>     sub bypackage {
>        
>         # make sure that __MAIN__ is always last on output
>         return  1 if $a eq '__MAIN__';
>         return -1 if $b eq '__MAIN__';
> 
>         my @a = split /::/, $a;
>         my @b = split /::/, $b;
>         
>         my $s = '$a[0] cmp $b[0]';
>         if (@a == @b) {
>             $s .= "||\$a[$_] cmp \$b[$_]" for 1 .. $#a;
>         } else {
>             my $min = @a < @b ? $#a : $#b;
>             $s = '$a[0] cmp $b[0]';
>             $s .= "||\$a[$_] cmp \$b[$_]" for 1 .. $min-1;
>             $s .= "||\@a <=> \@b";
>         }
>         return eval $s;
>     }

Gee, I must be missing something.  As far as I see, you only need to
split off the (final) function name.  Sort the package parts, and within
these sort the function names.  So:

    sub bypackage {
        my ( $apack, $aname) = $a =~ /(.+)::(.+)/;
        my ( $bpack, $bname) = $b =~ /(.+)::(.+)/;
        $apack cmp $bpack or $aname cmp $bname;
    }

[...]
    
> Bonus question: if speed was an issue, how could techniques such as
> the Schwartzian or Guttman-Rosler Transform be applied here?

I don't need to explain how to apply the Schwartz transform to my
suggestion.  The GRT doesn't seem to apply easily, as always when
different sort fields must be dealt with independently.

Anno


------------------------------

Date: Thu, 29 Jan 2004 10:50:10 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: 'by package' sorting of fully qualified functions
Message-Id: <bvaoh2$jjm$1@wisteria.csv.warwick.ac.uk>


tassilo.parseval@post.rwth-aachen.de wrote:
> Hi there,
> 
> I was in the situation to come up with a kind of special sort routine.
> The data to be sorted is a list of fully qualified function names as in
> 
>     Pack1::subpack::func2
>     Pack1::subpack::func1
>     Pack1::func
>     __MAIN__
>     Pack2::bla
>     Pack1::subpack::another_subpack::func
> 
> which ultimately should be sorted like this:
> 
>     Pack1::func
>     Pack1::subpack::func1
>     Pack1::subpack::func2
>     Pack1::subpack::another_subpack::func
>     Pack2::bla
>     __MAIN__
> 
> So essentially this should order these functions hierarchicly on their
> package name and finally on their function name. '__MAIN__' should
> always come as last element.
<snip>
> How would others solve this task?

#!/usr/bin/perl

$\ = $, = "\n";

use subs qw/hier_cmp bypackage/;

my @functions = qw/
    Pack1::subpack::func2
    Pack1::subpack::func1
    Pack1::func
    __MAIN__
    Pack2::bla
    Pack1::subpack::another_subpack::func
/;

sub hier_cmp {
    my @x = @{$_[0]};
    my @y = @{$_[1]};
    
    my ($x, $y) = (shift @x, shift @y);

    return $x cmp $y unless @x || @y;
    return 1         unless @y;
    return -1        unless @x;

    return ($x cmp $y) || hier_cmp \@x, \@y;
}

sub bypackage {
    return 1  if $a eq '__MAIN__';
    return -1 if $b eq '__MAIN__';

    my @a = split /::/, $a;
    my @b = split /::/, $b;

    return hier_cmp \@a, \@b;
}

print sort bypackage @functions;

__END__

I don't really like having '$x cmp $y' in there twice, but I can't see
how to get rid of it.

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  ben@morrow.me.uk   <=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>=<=>   (Kate Rusby)


------------------------------

Date: 29 Jan 2004 12:53:23 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: 'by package' sorting of fully qualified functions
Message-Id: <bvavo3$tc$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Anno Siegel:

> Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
>> Hi there,
>> 
>> I was in the situation to come up with a kind of special sort routine.
>> The data to be sorted is a list of fully qualified function names as in
>> 
>>     Pack1::subpack::func2
>>     Pack1::subpack::func1
>>     Pack1::func
>>     __MAIN__
>>     Pack2::bla
>>     Pack1::subpack::another_subpack::func
>> 
>> which ultimately should be sorted like this:
>> 
>>     Pack1::func
>>     Pack1::subpack::func1
>>     Pack1::subpack::func2
>>     Pack1::subpack::another_subpack::func
>>     Pack2::bla
>>     __MAIN__

[...]

> Gee, I must be missing something.  As far as I see, you only need to
> split off the (final) function name.  Sort the package parts, and within
> these sort the function names.  So:
> 
>     sub bypackage {
>         my ( $apack, $aname) = $a =~ /(.+)::(.+)/;
>         my ( $bpack, $bname) = $b =~ /(.+)::(.+)/;
>         $apack cmp $bpack or $aname cmp $bname;
>     }

Embarrassingly simple really. I initially was treating the function name
in a similar matter. But the major flaw in each of my attempts was that I
also split the package portion instead of just leaving it intact.

Alright, I'll retreat in shame.

>> Bonus question: if speed was an issue, how could techniques such as
>> the Schwartzian or Guttman-Rosler Transform be applied here?
> 
> I don't need to explain how to apply the Schwartz transform to my
> suggestion.  

Indeed not, thank you!

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: 29 Jan 2004 13:05:57 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: 'by package' sorting of fully qualified functions
Message-Id: <bvb0fl$1p9$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Ben Morrow:

> tassilo.parseval@post.rwth-aachen.de wrote:
>> Hi there,
>> 
>> I was in the situation to come up with a kind of special sort routine.
>> The data to be sorted is a list of fully qualified function names as in
>> 
>>     Pack1::subpack::func2
>>     Pack1::subpack::func1
>>     Pack1::func
>>     __MAIN__
>>     Pack2::bla
>>     Pack1::subpack::another_subpack::func
>> 
>> which ultimately should be sorted like this:
>> 
>>     Pack1::func
>>     Pack1::subpack::func1
>>     Pack1::subpack::func2
>>     Pack1::subpack::another_subpack::func
>>     Pack2::bla
>>     __MAIN__
>> 
>> So essentially this should order these functions hierarchicly on their
>> package name and finally on their function name. '__MAIN__' should
>> always come as last element.
><snip>
>> How would others solve this task?
> 
> #!/usr/bin/perl
> 
> $\ = $, = "\n";
> 
> use subs qw/hier_cmp bypackage/;
> 
> my @functions = qw/
>     Pack1::subpack::func2
>     Pack1::subpack::func1
>     Pack1::func
>     __MAIN__
>     Pack2::bla
>     Pack1::subpack::another_subpack::func
> /;
> 
> sub hier_cmp {
>     my @x = @{$_[0]};
>     my @y = @{$_[1]};
>     
>     my ($x, $y) = (shift @x, shift @y);
> 
>     return $x cmp $y unless @x || @y;
>     return 1         unless @y;
>     return -1        unless @x;
> 
>     return ($x cmp $y) || hier_cmp \@x, \@y;
> }
> 
> sub bypackage {
>     return 1  if $a eq '__MAIN__';
>     return -1 if $b eq '__MAIN__';
> 
>     my @a = split /::/, $a;
>     my @b = split /::/, $b;
> 
>     return hier_cmp \@a, \@b;
> }
> 
> print sort bypackage @functions;
> 
> __END__
> 
> I don't really like having '$x cmp $y' in there twice, but I can't see
> how to get rid of it.

I kind of like that. It's the recursive implementation of what my
function did. Yet I assume that you would have come up with a solution
similar to Anno's if I hadn't provided my ridiculously complicated code
that probably distracted you.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: Thu, 29 Jan 2004 18:27:50 +0100
From: Bo Lindbergh <blgl@hagernas.com>
Subject: Re: 'by package' sorting of fully qualified functions
Message-Id: <blgl-48B974.18274829012004@news.bahnhof.se>

How about this: split each fully qualified name into package name and
function name; use the package name as the key for a hash of arrays of
function names.  This lets you sort the package names first and then
sort the function names within each package separately.

/Bo Lindbergh


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 5994
***************************************


home help back first fref pref prev next nref lref last post