Jump to content

Recommended Posts

Hello semua putranians,

Aku dah belajar cara coding perl ni. Jadi aku nak combine dalam html. Camner yeK? Ni coding aku..

print "This is Perl FOR loop.\n";
print "-----------------------\n\n";


print "Count from 100 to 1 then stop.\n ";
print "----------------------------\n";
for ($count = 100; $count >= 1; $count--) { print "$count ";}
print "\n";


print "\nCount from 1 to 100 then stop.\n ";
print "----------------------------\n";
for ($count = 1; $count <= 100; $count++) {print "$count ";}
print "\n";

Share this post


Link to post
Share on other sites

Aku dah add camni:

#!/usr/bin/perl -wT

print "Content-type: text/html\n\n";
print "<html><head><title>Hello World</tile></head>\n";
print "<body>\n";
print "This is Perl FOR loop.\n";
print "-----------------------\n\n";
print "Count from 100 to 1 then stop.\n ";
print "----------------------------\n";
        for ($count = 100; $count >= 1; $count--) { print "$count ";}
print "\n";
print "\nCount from 1 to 100 then stop.\n ";
print "----------------------------\n";
        for ($count = 1; $count <= 100; $count++) {print "$count ";}
print "\n";
print "</body></html>\n";

Tapi tak jadi la..

Share this post


Link to post
Share on other sites

try ekjas -wT jadi #!/usr/bin/perl

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html><head><title>Hello World</tile></head>\n";
print "<body>\n";
print "This is Perl FOR loop.\n";
print "<br />";
print "-----------------------\n\n";
print "<br />";
print "Count from 100 to 1 then stop.\n ";
print "<br />";
print "----------------------------\n";
        for ($count = 100; $count >= 1; $count--) { print "$count ";}
print "\n";
print "<br />";
print "\nCount from 1 to 100 then stop.\n ";
print "<br />";
print "----------------------------\n";
        for ($count = 1; $count <= 100; $count++) {print "$count ";}
print "<br />";
print "\n";
print "</body></html>\n";

Share this post


Link to post
Share on other sites

Dah ok..Junior aku lupe nak add module perl dalam httpd.conf.. Penat aku godek.. Nak marah kan..budak baru kuar U..Tak tau ape2..Harap degree je ..

Share this post


Link to post
Share on other sites

Perl ada ajar kat universiti ke? biasanya belajar sendiri aja.. btw ko nak buat projek apa ni.. jarang lak aku nengok skang orang buat perl+cgi . kalo guna untuk UNIX shell tu biasa gak.. apart from SH

Share this post


Link to post
Share on other sites

Perl ada ajar kat universiti ke? biasanya belajar sendiri aja.. btw ko nak buat projek apa ni.. jarang lak aku nengok skang orang buat perl+cgi . kalo guna untuk UNIX shell tu biasa gak.. apart from SH

mnajem, SH tu apa?

Share this post


Link to post
Share on other sites

Ni aa..Aku dah letak pe yang perlu. Aku install LAMPP(Linux,Apache,Mysql,PHP,Perl) tapi web aku tak kuar la..Dah banyak kali aku restart..Aku nak run dalam cgi..

#!/usr/bin/perl -wT
 print "Content-type: text/html\n\n";
 print "Hello World.\n";

Ni aku punya config file.. http://pastebin.com/m6d5b124e

Edited by Firestarter

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...