in reply to How to convert a text file to a HTML file
#!/usr/bin/perl use strict; use warnings; open my $HTML, '>', 'output.html' or die $!; print $HTML <<'_END_HEADER_'; <html> <head><title></title></head> <body> _END_HEADER_ open my $IN, '<', 'input.txt' or die $!; while (my $line = <$IN>) { # You probably want to do more work here. print $HTML $line; } print $HTML '</body></html>'; close $HTML or die $!;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to convert a text file to a HTML file
by Utilitarian (Vicar) on Jan 25, 2013 at 12:20 UTC | |
by ghosh123 (Monk) on Jan 25, 2013 at 12:43 UTC | |
by RichardK (Parson) on Jan 25, 2013 at 13:14 UTC | |
by marto (Cardinal) on Jan 25, 2013 at 12:51 UTC | |
by ghosh123 (Monk) on Jan 25, 2013 at 13:04 UTC | |
by marto (Cardinal) on Jan 25, 2013 at 13:18 UTC |