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

[FWP] Drunk Driving redux (what was he thinking?)



I'm not sure if this is Fun With Perl but there is no Pathos With Perl list.
I needed to share this...

[quoting Tushar Samant of a few days ago (I like the sentiment) :]
> I saw code like this recently, and I hope the perp isn't reading this:

  opendir( dirPhdDir, $phdDirPath ) || die "couldn't open directory";
  while( defined( $szPhdFile = readdir( dirPhdDir ) ) ) {
      if ( index( $szPhdFile, ".phd." ) >= 0 ) {
          ( $szRoot = $szPhdFile ) =~ s/\.phd\..*$//;
	      # ... remainder elided as irrelevant to the current discussion
      }
  }

OK, stylistically, I really prefer all caps for filehandle / dirhandle
names...
and I don't like "C++-style" mixed case variables, but that's personal taste

The casual usage of the
    ($a = $b) =~ s/pat//;
idiom in the 4th line helped throw me off kilter.

TMTOWTDI... but sometimes, some of those ways are just plain the wrong
choice. At least, if one wishes to follow the True Path of Enlightenment as
regards "Making the Goal clearer to the Reader".


- Vicki
-- --
       |\      _,,,---,,_       Vicki Brown <vlb@cfcl.com>
 ZZZzz /,`.-'`'    -.  ;-;;,_   Journeyman Sourceror: Scripts & Philtres
      |,4-  ) )-,_. ,\ (  `'-'  P.O. Box 1269  San Bruno  CA  94066
     '---''(_/--'  `-'\_) http://www.cfcl.com/~vlb  http://www.macperl.com

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