wolverina has asked for the wisdom of the Perl Monks concerning the following question:
But when i add this to the bottom, to write the contents to a file, the resulting file is not formmated.Textfile = "file.htm"; open (FILE,"$FORM{'TextFile'}"); @LINES = <FILE>; close (FILE); $text = join(' ',@LINES); $text =~ s/\n/ /g; foreach $variable (@variables) { if ($FORM{$variable} eq "") { print "incomplete!\n"; exit; } $text =~ s/<!--$variable-->/<STRONG>$FORM{$variable}<\/STRONG> +/g; } $text =~ s/A\/an <STRONG>(a|e|i|o|u)/An <STRONG>$1/g; $text =~ s/a\/an <STRONG>(a|e|i|o|u)/an <STRONG>$1/g; $text =~ s/A\/an/A/g; $text =~ s/a\/an/a/g; print $text;
Would anyone know why the browser displays the contents formatted, but the file is saved unformatted? Thanx, Lisa.open(OUT,">$Textfile") or die $!; print OUT "$text\n" or die $!; close(OUT) or die $!;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Retain file format
by Zaxo (Archbishop) on Aug 14, 2002 at 05:51 UTC |