Perl Programming Tutorials

PERL Programming Tutorials And Articles
  Title / Author Replies
Views
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,237
Introduction If you're like most people, you probably have a bunch of MP3s scattered around your hard disk. And if you're like most people, you probably also have on your to-do list a plan to inspect and catalog them so that you know exactly what you're listening to. It's just that you...
0
7,355
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,321
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,172
At some point while writing a CGI script in Perl, many newbies have needed to print all the environment varibles in Perl, sometimes for debugging or for the sake of curiosity. Well, here is the code to print all the CGI environment variables. #!/usr/bin/perl print "Content-type:...
1
3,811
Introduction Perl is renowned for being a language where you can express complicated commands in a very small amount of space. We'll start with the simplest of programs, which simply reads in characters from the keyboard and repeats them back to the console. In Perl you might write this...
1
5,037
List of common file extensions and their corresponding MIME types in a hash, which can be quite use at times. %mime_types = {'.ai','application/postscript', '.aif','audio/x-aiff', '.aifc','audio/x-aiff', '.aiff','audio/x-aiff', '.asc','text/plain', '.au','audio/basic', ...
1
3,173
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,661
How to direct a browser to display a different HTML page This is actually very simple to do in a CGI script. Instead of the usual header Content-type: text/html #make your script print this Location: URL to display #Don't forget the blank line afterwards. -or- print...
0
8,823
Different Operating Systems use different characters as their path separator when specifying directory and file paths: foo/bar/baz # *nix uses a / foo\bar\baz # Win32 uses a \ foo:bar:baz # Mac OS 9 uses a : foo/bar/baz # Mac OS X uses a / (usually!) In Perl you can generally...
0
4,131
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,137
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,534
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,854
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,893