Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Replies
Views
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
3,413
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
12,704
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
18,560
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
6,543
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
18,402
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
15,008
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
149,642
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
14,577
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
68,209
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
11,938
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
5,889
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
13,528
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
3,809
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,389
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,226
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
63,166
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
24,802
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,017
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
25,283
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
7,477