Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
Views
Connect to a MySQL server using Perl. In order to do that you'll have to use the DBI module in Perl. Below you will find an example code. #!/usr/local/ActivePerl-5.6/bin/perl -- print "Content-type: text/html\n\n"; print "<html><head><title>Database Test Page</title></head><body...
0
2,882
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,250
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,572
Showing a page process time in the page footer is a common thing in many sites, some sites even take it forward by showing DB query time and processing time separately. In this tip, we'll see how to show page process time in perl. For this purpose we'll require the perl module Time::HiRes...
0
5,092
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,467
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,201
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,903
Introduction To Hashes In Perl (http://www.go4expert.com/showthread.php?t=8518) Preserve Add Order Perl doesn't guarantee the order of the elements of hash, they may be in a different order everytime you access the hash. It's a much wanted, rather expected behaviour that I get my elements...
1
23,892
In rashida.par's Recursive function to find X to the power n (http://www.go4expert.com/showthread.php?t=9307) I see that she intelligently used recursion to find the power of x to n. So, I was wondering whether we can do this iteratively also, I always do that - trying to find a iterative solution...
1
11,590
Introduction Templating, you can say is a way to separate the business logic from the presentation logic. Most of the world's we application developers use either embeded scripting languages like PHP, JSP, ASP etc. while other use print statments in the scripting languages to output their...
0
3,795
Here are a few tips & tricks which you may find useful when dealing with files/directories in Perl. Perl Test Operators +-------------+------------------------------------+ | Operator | Function | +-------------+------------------------------------+ ...
0
4,725
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,008
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
12,793
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,337