#!h:\bin\xampp\perl\bin\perl.exe print "Content-type: text/html\n\n"; print <<EOT; <!doctype html> <html> <head> </head> <body> <h1>Teszt CGI program</h1> EOT open FAJLNEV, "<", "filenev.txt" or die $!; $sor = <FAJLNEV>; print $sor; open FILEID, ">", "filenev.txt" or die $!; print FILEID ++$sor; close(FILEID); print <<EOT; </body> </html> EOT
Win32 XAMPP-al:
Linuxon:
#!"C:\xampp\perl\bin\perl.exe" use CGI; $q = CGI->new; print $q->header, $q->start_html('Helló Világ'), $q->h1('Helló Világ'), $q->end_html;
UTF-8 beállítása:
#!/usr/bin/perl my $title = "Teszt"; print "Content-type: text/html\n\n"; print <<EOT; <!doctype html> <html> <head> <meta charset="utf-8"> <title>$title</title> </head> <body> <h1>Teszt</h1> <p>törzs</p> </body> </html> EOT exit;