Thread In Perl Script: Javascript Code auslagern (5 answers)
Opened by Gast at 2005-02-12 15:59

steffenw
 2005-02-13 00:10
#4356 #4356
User since
2003-08-15
692 Artikel
BenutzerIn
[Homepage] [default_avatar]
... aber keiner verbietet Dir, mit Perl Javascript zu erzeugen.

Bei mir sieht das z.B. im HTML aus:
Code: (dl )
<script language="JavaScript" src="http://localhost/cgi-bin/wi_termin.pl?filename=wi_termine.txt" type="text/javascript"></script>

und in Perl:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
#!/bin/perl -T
use strict;
print "Content-Type: text/html\n\n";
...
print "var _termine = new Array (\n";
for (@termin)
{ sprintf
qq~ new Array (%d, "%s", "%s"),\n~,
...
}
...
$SIG{USER} = sub {love 'Perl' or die};

View full thread In Perl Script: Javascript Code auslagern