Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Replies Reverse Sort Order
Views
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,161
As Perl programmer we might want to shoot off a mail for some reason or the other, especially if we've used Perl for the web. Perl being such a powerful language, it's can do virtually anything you want to do with it. Sending a mail is a piece of cake, be it using sendmail or using SMTP. CPAN is a...
10
19,335
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,477
Introduction May times we require to check whether a process is running or not, may be for the purpose of maintaining a lock file for a process or for some other reason. Here today we'll discuss a technique in which we can do this checking provided the process/pid being checked is checked is...
8
19,135
When your script writes to a new file, you probably want it to create a new and unique name for the new file, one that doesn't conflict with any existing files, which would be overwritten. One way to create a new file name that's unique is to incorporate the process id and the time into the name....
7
9,276
When Perl is given a file to execute or a string as a command line option (using -e), it needs to parse the contents, check it for syntax errors, and, if all is fine, execute it. Perl makes this feature available to the programmer through the eval string form. This contrasts powerfully with...
7
14,344
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,585
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,238
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,323
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,018
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,373
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,484
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,490
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,935
Introduction One of the strengths of PHP when it comes to arrays is considered to be the in_array function (http://php.net/in_array), this function takes two parameters; the array and the item to be searched in the array and then returns a boolean result whether the item exists in the array....
4
31,569
Introduction IRC is a very easy protocol to communicate with once you get the basics. I'll be showing how to create a 'bot' (=robot) in the well-known scripting language Perl. All the commands sent to the server can also be ported to any other programming or scripting language. I will not go...
4
12,568
While modern browsers will work around many syntax problems in your HTML, if you want to ensure consistent pages across multiple browsers, it's a good idea to check the syntax. That's where HTML::Lint comes in. We'll show you how to use this powerful syntax-checking tool. Modern browsers...
3
7,761
A hash is a data structure that associates keys with values. The primary operation it supports efficiently is a lookup: given a key (e.g. an employee's id), find the corresponding value (e.g. that employee's name). It works by transforming the key using a hash function into a hash, a number that is...
3
22,727
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,563
Ceil in Perl Cieling is basically outputing the next largest integer for an given real number. ceiling(x) is the smallest integer not less than x Ways to do it in Perl, a) using our own logic my $num = 45.4; my $ceil = int($num + 0.99);
3
71,885