This is the first thing I've written apart from little tutorial excercises, and it was suggested that I post this to SoPW for further advice, so here goes...
All this does is take an HTML file (or any file, really), wrap an ASP Response.Write command around each line, and dump it back out to a file. Nothing fancy, but I'd like to know if there's something I could be doing better.
($infile, $outfile, $indent) = @ARGV; open(IN, $infile) or die "Can't open input file: $!"; open(OUT, ">" . $outfile) or die "Can't open output file: $!"; print "Starting..."; print OUT "<%\n"; while(<IN>) { chomp; print OUT (" " x $indent) . "Response.Write("; if ($_) { print OUT "\"$_\" + "; } print OUT "vbNewLine)\n"; } print OUT "%>\n"; print "Done."; close IN or die "Can't close input file: $!"; close OUT or die "Can't close output file: $!";
And thanks to the chatterbox folks for helping me with the most egregious errors!
In reply to A simple input/output script, suggestions wanted by patgas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |