tojsstr.pl
JSの中にHTMLを埋め込みたいとき……
perl jsstr.pl file1 file2 ...
#! /usr/bin/perl # tojsstr.pl use strict; my @files = @ARGV; foreach my $file (@files){ my $f = 0; open( my $in, $file ); while( my $line = <$in> ){ chomp($line); $line =~ s/"/\\"/g; print( ($f ? '+' : '') . '"' . $line . '"' . "\n" ); $f++; } close($in); }