Perlscripte in Plaintext ausgeben
Aquariophile
- perl
0 i-netlab0 Eidgenosse
Hallo!
Ein Perlscript soll in Plaintext ausgegeben werden.
Dazu dachte ich an den print <<'EOF';
Beachtet bitte alle Leerzeilen die ich machte (welche erhalten bleiben sollen)
egal ob ich es mit <<"EOF" oder <<'EOF'; oder <<EOF; mache,
es kommt immer was anderes raus als im Source steht.
Bitte um Hilfe.
Ganz unten steht wie es aussehen sollte.
Danke!
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title></title><body bgcolor="#FFFFFF">";
print <<'EOF';
#############################################################
$bla="a:b:c:d:e:f:g";
($login,$passwd,$uid,$gid,$gcos,$home,$shell) = split(/:/, $bla);
print $login."<br>\n";
print $passwd."<br>\n";
print $uid."<br>\n";
print $gid."<br>\n";
print $gcos."<br>\n";
print $home."<br>\n";
print $shell."<br>\n";
#############################################################
EOF
print "</body></html>";
############################################################# $bla="a:b:c:d:e:f:g"; ($login,$passwd,$uid,$gid,$gcos,$home,$shell) = split(/:/, $bla); print $login."
\n"; print $passwd."
\n"; print $uid."
\n"; print $gid."
\n"; print $gcos."
\n"; print $home."
\n"; print $shell."
\n"; #############################################################
############################################################# ="a:b:c:d:e:f:g"; (,,,,,,) = split(/:/, ); print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; #############################################################
############################################################# ="a:b:c:d:e:f:g"; (,,,,,,) = split(/:/, ); print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; print ."
"; #############################################################
#############################################################
$bla="a:b:c:d:e:f:g";
($login,$passwd,$uid,$gid,$gcos,$home,$shell) = split(/:/, $bla);
print $login."<br>\n";
print $passwd."<br>\n";
print $uid."<br>\n";
print $gid."<br>\n";
print $gcos."<br>\n";
print $home."<br>\n";
print $shell."<br>\n";
#############################################################
DANKE!
Aquariophile
hi,
egal ob ich es mit <<"EOF" oder <<'EOF'; oder <<EOF; mache,
es kommt immer was anderes raus als im Source steht.
Jow, das ist das quoten ;-)
So wie du EOF quotest wird das ganze here Doc auch ge-quotet.
Beispiel: 'EOF';
\n wird als \n geprintet
"EOF";
\n ist ein Newline
Rolf
Hallo Aquariophile,
Setze um das Ganze ein
print "<pre>\n";
print <<'EOF';
...
EOF
print "</pre>\n";
Die <br> mußt Du maskieren.
Gruß
Eidgenosse