Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
Views
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,938
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,910
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,136
Below is a small Perl code that Shows all the environment variables of the Server on which it is run. #!/usr/bin/perl print "Content-type: text/html\n\n"; print "<tt>\n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<p>";
0
3,934
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,440
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,677
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,232
The normal idea is to have an hash table, iterate over the array and using the elements as keys. Something like ::( my @array = (1,5,3,7,9,1,4,5,7,6,7); my %hash; foreach my $element (@array) { $hash{$element}++ }
6
6,458
Many programs use the STDOUT to produce some normal output and the STDERR to show the errors. I'm actually working with the g++ that do this and a question appeared. Wouldn't be nice to see it with different colors? #!/usr/bin/perl use strict; use warnings; use IPC::Open3;
2
5,788
After allot of searches like 'find . -type f -exec grep main {} -H \;' I implemented a small program :eek:. ;) This program uses the normal 'file' shell command to check if a file is a text file. ;) Ignores files inside /CVS/. They are there, but who cares? ;) Clearly...
1
7,414
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
48,099
I was wondering whether its possible to write a program which acts like a proxy server in Perl, so what I figured out was anything is possible with Perl. Below is the code, try it, its wonderful. I used threads to manage multiple requests, so the program can handle multiple requests...
12
18,310
Getting a recursive listing of all the specified directories within a specified path using FTP. We sometimes requires to calculate the number of directories or the number of files, and sometimes even the total size of files inside the specified directory. The following code is written to get the...
6
26,918
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,836
How often have you wanted to find out the current user's name or system group within a shell script? Or wanted to get the current process ID? Well, if you're using Perl, it's nowhere near as difficult as you might think. That's because Perl comes with a library of functions designed...
1
25,379
Read An Entire File All At Once At times we need to read the contents of a file all at once, instead of reading line by line, or reading the contents line-wise into an array, here's how we can read the contents of a file into a scalar as text. open FILE, '</tmp/page.html' or die $!;...
3
14,698
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,372
Introduction Pagination is a very basic requirement of a web application, in this article we'll see how to implement pagination easily using the Perl module Data::Pageset. Basically there are two types of pagination, Jumping and Sliding. In the jumping type the current page jumps from the...
2
8,318
Introcution Amazon's S3 is a really amazing service, where you can store unlimited amount of data at a very cheap rate, and the service being really reliable at the same time. Signing up for the service is really easy, you are charged a very low rate only for what you use, you can read more about...
1
5,095
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,873