mjd-perl-pm on Wed, 2 May 2001 16:25:14 -0400


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

Re: Quick question: how to slurp a file?


> > @EntireFile = <FH>;
> > $File = join("",@EntireFile);

Actually, just a couple of days ago I put this into the 'Program
Repair Shop' as an example of "Don't take two steps forward and one
step back."  <FH> makes Perl go to all the trouble of splitting up the
file into lines; then the 'join' smashes all those lines back together
again.

**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**