http://www.perlmonks.org?node_id=561320


in reply to Perl is dying

I'm sure I'm gonna repeat what others must have said alerady. I don't give a damn about CGI. Out of all the stuff I do in Perl, CGI (or some other way to put dynamic content on the web) comprises just a few percent. Very few. And I'm far from being an exception. Yeah, newbies who want a counter on their web page are not flooding Perl newsgroups and mailing lists with their "how do I sum two numbers" type questions anymore. I can't say I miss that.

Programming gt WWW && WWW gt pages.

BTW, cleaner alternatives to Schwartzian Transform? A hard to use and hard to learn module because someone can't grok the concept? Maybe we should dump closures and unnamed subroutines too. Some people can't grok those too. Usualy the same people.

Replies are listed 'Best First'.
Re^2: Perl is dying (hyperbole)
by Aristotle (Chancellor) on Jul 16, 2006 at 08:10 UTC

    The ST is suboptimal among several axes. Its only real advantage is that it’s a single expression. I don’t know why people insist on using it in places where that’s of no benefit.

    And no, none of the alternatives I use involve modules. Next time, try to argue without putting up a strawman and then adding a slippery slope to it.

    Makeshifts last the longest.

        Generally I use an extra array for extracted keys and then use it to sort indices.

        my @sorted = do { my @key = map { lc substr $_->[ 4 ], 0, 3 } @a_of_a; my @idx = sort { $key[ $a ] cmp $key[ $b ] } 0 .. $#key; @a_of_a[ @idx ]; };

        That’s much easier to follow than the ST. Additionally, it uses orders of magnitude less memory for large datasets because it doesn’t create zillions of tiny anonymous arrays. (I love Perl’s effortless data structures and what they enable, I really do, but roughly 100 bytes of overhead for an empty array… talk about wasteful.) It’s also faster for the same reason. In fact, it’s a speed demon – as fast as it gets without a GRT, or possibly faster if the transform you need for your GRT is costly.

        What’s not to like? I see very little reason to use a classic ST.

        Makeshifts last the longest.

Re^2: Perl is dying
by apotheon (Deacon) on Jul 19, 2006 at 08:03 UTC

    Maybe we should dump closures

    Don't you dare! I may have to burn down your house if you do that.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin