Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
Views
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,344
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,446
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,024
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,057
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
8,782
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
8,959
Many times we require to output the time difference between two dates/time in human readable form like '5 minutes 18 seconds'... Writing a whole subroutine to perform the same can be tiresome and messy, I've written a small subroutine which uses Perl's gmtime function to achieve the same. sub...
0
10,016
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,820
There is a function ucwords() in PHP which capitalizes the first letter of each word. <? $str = "programming forums"; $str = ucwords($str); // now $str = "Programming Forums" ?> I have written a sub-routine in Perl, which gives the same functionality.
1
7,600
Introduction Usually we run various scripts like newsletter mailer, backup scripts, etc. which take quite a lot of time, making us think of some ways to make it faster. One way to make it faster is to run some operations in parallel, like sending email to 20 subscribers in parallel for the...
1
31,179
Everyone knows that Perl is extremely fast when it comes to handling regular expressions and text processing... but have you ever wondered how fast is extremely fast? Well, one of the toys us big kids have at our disposal is the Perl Benchmark module, which lets you test the speed of a Perl script....
0
7,070
I am assuming from now on that you are familiar with substitution operator in perl: s///. A basic example: $str =~ s/apple/orange/; would replace the word "apple" with the word "orange". The separator "/" we used in this example can be replaced with any other non...
0
25,934
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,312
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,234