Script to see if Perl is working ! :E !

October 2nd, 2009 Posted in Scripts for Testing, Useful if needed

perl01

There are 2 ways to Test if Perl is working properly on your system.

1. Webserver

welcome.pl:

---------------------
#!/usr/bin/perl 
# 
# =========== 
# helloworld.pl 
# =========== 
# 
print "content-type:text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>Hello World</title>\n";
print "</head>\n";
print "<body>\n";
print "<b>Hello World!</b><br>\n";
print "</body>\n";
print "</html>\n";
# 
# 

-----------------------------------------
Save it and run it by http://your webserver/myscript.pl

2. Shell

myscipt2.pl:
-----------------------
#!/usr/bin/perl
print "Hello World.\n";
----------------------

run from shell like 

perl myscript2.pl

it will print a line saying Hello World.
  • Share/Bookmark
Tags: , ,

Leave a Reply

Powered by WP Hashcash

Get Adobe Flash playerPlugin by wpburn.com wordpress themes