[OT] Perl Question

Dan Nguyen nguyend7@cse.msu.edu
Mon, 27 Mar 2000 20:49:05 -0500


On Mon, Mar 27, 2000 at 08:17:09PM -0500, Sean wrote:
> You can also use a foreach. I usually use an html template with
> places for the variables and do a substition for the data. It might be a
> bit more processor intensive, but its a lot easier to maintain since you
> can still pull the html file into the html editor of your choice. 
>  

Yes you could use foreach, especially if you don't mind reading the
entire file into memory.

@lines = <FILE>;
foreach $var (@lines) {
  #foobar;
}

And you might be able to do

foreach $var (<FILE>) {
  #foobar;
}

but remember... TMTOWTDI.


-dan

PS. for those who don't know TMTOWTDI... check the footnotes of page
13 of your camel book.

-- 
     Dan Nguyen     |  It is with true love as it is with ghosts;
  nguyend7@msu.edu  |  everyone talks of it, but few have seen it.
   dnn@debian.org   |                 -Maxime De La Rochefoucauld