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

[FWP] beauty vs. brains



I've often done

  $file = do { local $/, <FILE> };

when I wish to slurp a file into a scalar.  However, I recently realized
that doing

  read(FILE, $file, -s FILE);

can be done in NEARLY half the time.  I don't see it done (at
all) though.  I'll admit showing my $/ prowess is nice, but also showing
my "know when to be spiffy-looking" prowess is nice too.

-- 
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve             japhy@pobox.com
http://www.pobox.com/~japhy/                  http://pinyaj.stu.rpi.edu/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe