Quick perl q =)

Dpk dpk@egr.msu.edu
Tue, 9 Jan 2001 08:45:23 -0500


On Mon, Jan 08, 2001 at 10:22:52PM -0500, Ben Pfaff wrote:

   Sean <picasso@madflower.com> writes:
   
   > I have something that works, but basically I was bulk creating a website.
   > I have a page-form and need to insert two files or preformatted html
   > into it at certain spots. 
   
   The commands
   	open (INPUT, "<FILENAME");
   	while (<INPUT>) {
   		print OUTPUT $_;
   	}
   	close (INPUT);

   will open a file named FILENAME and output its contents to the
   file with handle OUTPUT.  Is that what you need?

Can be shortened as well:

open(INPUT, "<FILENAME");
print <INPUT>;
close INPUT;

Fyi.

Dennis Kelly
Network Administrator
College of Engineering
Michigan State University