[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [FWP] Cool hack of the week



> From: Mark-Jason Dominus [mailto:mjd@plover.com]
> Sent: Monday, June 28, 1999 00:13
> To: Larry Rosler
> Cc: 'Mark-Jason Dominus'; Michael Budash; fwp@technofile.org
> Subject: Re: [FWP] Cool hack of the week 
> 
> > Try as I may, I fail to find a four- or five-line locution there! 
> 
> No doubt your powers are at low ebb due to the late hour.  In the
> morning it will be obvious that if you write this code with the usual
> line-breaking conventions, it is four lines long.
> 
> I am not making this up.  Three-line versions of this locution appear
> on page 248 of the Perl Cookbook, in perlfaq5, and in perlfaq8.  These
> versions are incomplete because they fail to provide correct scope to
> the temporary variable.  If they were complete, they would each be
> four or five lines long.

Why anyone would write it any differently from the way you did -- on one
line, with two semicolons -- is beyond my understanding.

> > Talk about mountains and molehills...
> 
> If you don't like it, you don't have to use it.  But if you think I'm
> making mountains out of molehills by inventing an unneccessary
> ->autoflush() feature, I suggest you direct your criticism to the
> person originally responsible for including an ->autoflush() method in
> Perl's standard distribution six years ago.  His name is Larry Wall.
> 
> My only contribution here was to show how to enable this function
> *without* loading 100Kb of other modules.  If your criticism is that
> loading 100Kb of other modules is a molehill, I respectfully disagree.

The molehill is the autoflush problem itself.  The mountain is the use
of *any* module to solve it.

The 'save-in-an-array' hack is rather bizarre, though I've used it for
fun (which is what this list is about, yes?)  But your ONE-liner is so
straightforward that any programmer should be able to use it.  Without a
module.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com  

==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org