Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Replies
Views
Hi, Perl has been very famous for providing with very small but very useful programs, especially for the web. Hit Counters are one of such domains. Here is a small perl code to implement a basic hit counter in a web page #!/usr/bin/perl -wT print "Content-type:text/html\n\n"; $log =...
1
8,363
Hi friends, This is a very simple example demonstrating how to implement cookies in perl. This File (set.pl) sets the cookie- #!/usr/bin/perl use CGI qw(:standard); use CGI::Cookie;
0
9,622
Well this has been out for quite sometime now, so i thought to share with all out here. Heres a PERL script demonstrating how to retrieve the data from the Google Suggest Drop Down Autocomplete and use it as you please! This was developed by John Bokma , but worked in command line only. So i have...
0
8,195
Different Operating Systems use different characters as their path separator when specifying directory and file paths: foo/bar/baz # *nix uses a / foo\bar\baz # Win32 uses a \ foo:bar:baz # Mac OS 9 uses a : foo/bar/baz # Mac OS X uses a / (usually!) In Perl you can generally...
0
4,177
How to direct a browser to display a different HTML page This is actually very simple to do in a CGI script. Instead of the usual header Content-type: text/html #make your script print this Location: URL to display #Don't forget the blank line afterwards. -or- print...
0
8,892
As the world is fast becoming aware of the benifits of XML, perl developers would also want to use XML in their CGI-Perl scripts. XML parsing seems to be one hell of a job when you look at the XML::Parser module, but XML::Simple comes to the rescue with the ease of use it brings. Installing...
4
47,956
Many times we need to check whether a number is negative or not, here is a very simple subroutine to do that. sub isNegative { my($checkValue) = @_; if(abs($checkValue) != $checkValue) { # the value is negative return 1; }
0
8,805
At some point while writing a CGI script in Perl, many newbies have needed to print all the environment varibles in Perl, sometimes for debugging or for the sake of curiosity. Well, here is the code to print all the CGI environment variables. #!/usr/bin/perl print "Content-type:...
1
3,887
There are many ways to send email from a Perl script, one the all time popular being using sendmail. But, there are other ways of sending emails, one of which is using the module Net::SMTP.All you have to do is to include the Net::SMTP module in your script and try using the example below. ...
9
64,519
Introduction Perl is renowned for being a language where you can express complicated commands in a very small amount of space. We'll start with the simplest of programs, which simply reads in characters from the keyboard and repeats them back to the console. In Perl you might write this...
1
5,127
List of common file extensions and their corresponding MIME types in a hash, which can be quite use at times. %mime_types = {'.ai','application/postscript', '.aif','audio/x-aiff', '.aifc','audio/x-aiff', '.aiff','audio/x-aiff', '.asc','text/plain', '.au','audio/basic', ...
1
3,235
This is a password generator script that I have written. Any feedback, critique or suggestions would be much appreciated. #!/usr/bin/perl ## *************************************************************************** # # genpass v1.0 (06.2007) Password Generation Program # ...
6
15,024
Working with dates is a very common feature of any application, be it a web app or a desktop one. Some people consider Perl to be a language where working with dates is hard, but basically it's quite easy if you know how to. Datetime is a common term while refering to date and time together. ...
6
151,399
Introduction Sanitizing HTML is just removing unwanted HTML elements from any inputted HTML code, it does not validate HTML code. We all have seen many sites which allow you to post comments using only a few HTML elements like <a>, <b>, <i> etc. the other HTML tags are automatically removed,...
1
9,246
Introduction We all write programs to run on the terminal to do jobs that take time, like processing logs, sending out newsletter, etc. To know the progress of our task we print some messages to know our program is running well and doing its job. But wouldn't it be nice if we could add a...
5
13,500
See the following questions. It will improve your PERL knowledge. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Question 1 How do you perform a forward declaration of a subroutine performed? Choice 1 forward sub name; Choice 2
2
13,487
For my first thread i will post my new twitter bot/rat. This will only work on linux and possibly mac Its more of a funny prank than a rat, but it can be used for malicious purposes. You need to get your victim to open the .pl file on their computer and leave it open, if your using this on...
7
4,610
Have you ever wondered how a search engine like Google works? Well, it uses web crawlers and web spiders which “crawl” the web from one URL to all connected URLs and so on retrieving relevant data from each URL and classifying each web page according to some criteria and storing the URL and related...
5
16,528
JSON has become a popular data representation format, and can been seen as the successor of XML which used to be the most popular format used for data exchange between systems. Notable examples of JSON being used for data representation are Facebook Graph API & Flickr API, amongst many others....
0
8,583
Most modern day websites take inputs from user in the form of comments, reviews, PMs etc. and it's needed to control the HTML tags in the users' content to prevent XSS attacks, spamming with URLs, embedding videos - which might attract copyright problems - and similar problems. Many sites list...
2
4,546