SPUG: Damiathon Pix on SPUG Page now

Dean Hudson dean at ero.com
Mon Jul 24 18:11:55 CDT 2000


On Mon, Jul 24, 2000 at 02:23:03PM -0700, Tim Maher/CONSULTIX wrote:

> Is this on the level?  Who's that, besides some guy I've never heard of? 
> I think I prefer my initial position that he's Nat Torkington.

Which is okay, aside from being incorrect. :) Here's evidence of his
existence from p5p:

From: Ronald J Kimball <rjk at linguist.dartmouth.edu>
To: Jeff Pinyan <jeffp at crusoe.net>
Cc: abigail at foad.org, Bernie Cosell <bernie at fantasyfarm.com>,
        fwp at technofile.org, perl5-porters at perl.org
Subject: Re: [FWP] Comparing two arrays
X-Mailer: Mutt 0.95.4i
In-Reply-To: <Pine.GSO.4.21.0007231714460.4304-100000 at crusoe.crusoe.net>; from
+Jeff Pinyan on Sun, Jul 23, 2000 at 05:18:16PM -0400                   
 
On Sun, Jul 23, 2000 at 05:18:16PM -0400, Jeff Pinyan wrote:                 
> Yup, I know.  Sadly, Perl doesn't optimize                          
>
>   ($a,$b,$c) = (split)[-3 .. -1];                            
>
> the same way it optimizes                                    
>
>   ($a,$b,$c) = (split)[0..2];  # [0..2] optional, I believe...
 
perl doesn't optimize either of those.  If you want the optimization, you
have to write:                            

($a,$b,$c) = split;                                                           
 
_without_ the list slice.                                       
 

> And if it DOES optimize this, I am highly unaware.  It'd be quite nice of
> Perl to do this.  How possible is this optimization?                 

The first argument to split is a regex, so I think this optimization would
not be possible at all.  Perhaps in the most trivial cases, such as /a/,
but then you wouldn't save much in an optimization anyway.         

Ronald                     

--
my $email = qr{ dean(h)?@(?(1)verio\.net    # @ work if h
                            | ero\.com) }x; # other

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list