On Wed, 01 Oct 2003 23:14:00 -0700
Bryan Harris <[EMAIL PROTECTED]> wrote:
>
> What I'm interested in is what's the easiest way to print the contents of a
> file? For example, if I want to output my header file, "header.incl", how
> can I print the contents of that file the easiest (and most generally
> compatible)?
Firstly specify the file;
$file = "/location/of/header.incl";
Next open it for reading
open (FH, "$file") or die "Cannot open file $file $!";
Lastly, go through the file line by line and print them
while(<FH>){
print "$_"; #$_ is the value of the current line
}
You may wish to change the print line to print "$_<br>\n"; if you want a new line
on your html for each new line in your file.
Owen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]