-
Recent Posts
Tags
app engines attributes cgi database DBI Debian frameworks full screen terminal GWT hacks hardware hobbit howto html inheritance javascript jQuery libraries Linux mac oracle OSX parallels Perl photoshop pixels PostgreSQL programming qa regression testing screen size Software Development style template toolkit term Theory translation type cast User Interface virtual machine virtual machines visual studio vmware web design web programming
Tag Archives: Perl
Web Applications on a Mac: hello world perl CGI
Step 1) enable web sharing a.k.a. Apache web server: go to system preferences => sharing, and click Web Sharing Step 2) make sure Apache is running by going to the address ‘http://localhost’ in your browser. You should see the message “It Works.” Step 3) In the default setup, http://localhost/cgi-bin is aliased to the directory /Library/WebServer/CGI-Executable, [...]
Perl: Inheritance Seems Broken (Because It Requires an Instance)
I want to demonstrate how in Perl, when one class inherits from another, methods from the parent class are inherited as long as the derived class is being called in an object oriented manner. So here is some code for the parent class: package Animal; use warnings; use strict; sub new { my ($class) =@_; [...]
toString() For Perl Objects
I’m working my way through “Programming Perl” and pulling out the little tidbits that I find most useful. The following is a method for overloading the double quote operator (Perl’s version of Java toString()) so that you can just print an object with a statement like ‘print $object1′ and get something coherent. The basic approach [...]
Private Methods in Perl Objects
It is common to use a naming convention to indicate that a perl method is private. I have seen the double underscore used, as in __initialize or __disconnect. Reading ‘Programming Perl’ however, there are a number of methods for actually making code private. Below is an example of one method, using a subroutine reference. Someone [...]
Magic DBI incantation returns array of hashes keyed by column names