Posts by John Scoles
Holy Zarquon just released the initial results of the 2010 Perl Survey. The slides are also available. Now for my 2cents worth. Looking at the results I see that very few of the respondents have be ‘taught’ Perl (slide 16) and the majority have an educational background in Computing or Engineering.I think that we in the Perl community should be asking why ‘Perl’ is not being taught at higher institutions.
If you have ever had this message: Unable to locate an oracle.mk, proc.mk or other suitable *.mk file in your Oracle installation. (I looked in…) It can be a very frustrating one to track down. There is no 100% answer for this problem but there seems to be two main scenarios where I have encountered this and have come up with somewhat of a solution, here it is.
I have successfully compiled and installed DBD::Oracle on Windows 2008 Server 64bit operating system today. I used the latest version of DBD::Oracle 1.24, version 22.214.171.124.0 for 64bit Windows of Oracle’s Instant Client Package – Basic along with the Instant Client Package – SQL*Plus and finally the Instant Client Package – SDK. Here are some instructions that will help with the install.
The “Beer” version of DBD::Oracle (1.24) has been released. You can find it at CPAN DBD::Oracle. DBD::Oracle is a Perl module that works with the DBI module to provide access to Oracle databases. It is maintained by me, John Scoles, under the auspices of Pythian as Open Source/Free Software. This is largely a maintenance release that fixes a number of bugs. New stuff includes some more improvements to embedded types from Charles Jardine. Find out more here.
My old arch-nemesis, the in-line if ($q = $q == $a ? $b : $c;) reared its ugly little head again. This time, it was in context of an web page that displayed some form values. Here’s what I did.
One thing I find fascinating in Perl is that I am always seeing new ways to perform the same mundane task. Today I had to output some tabular data, so I thought it would be nice if I alternated colors for each row. Easy enough in Perl—just create a hash with your colours as the value and then the swapping variable as the key, like this…
I installed DBD::Oracle on an IBM AIX 5.1 box, and for once I have some good news. Anyone who has ever tried this will know of some of the troubles I speak of. When dealing with DBI and any DBD on a AIX box, you either must either be lucky enough to have the same compiler installed that built the version of Perl that comes with the box (I have never seen this happen); or you have to spend a great deal of time downloading and installing your own GCC and the building your own version of Perl. Fortunately, all the hard work was done for me by other members of my team. Here’s how to do it.
This is a little story of a little bug. This gremlin suddenly appeared in a CGI.PM web-based application I work with. To make a long story short, an email was coming out something like this . . . I discovered that the page was in fact receiving three values for CGT::param(“rep_no”) when user was of type ‘B’, and thus sending that as an array to the send_TXT_email method, and as a result, buggering up the email content. Even more digging I found out the root cause was a web page that was three pages back from the one that was sending the email. Here’s the quick fix.
I had an opportunity over the past few days to attempt to use Microsoft’s Server Management Objects (SMO) with Perl to manage a SQL Server 2005 DB. To make a long story into a short post, I blundered into the Win32::CLR module on CPAN, a little gem from Toshiyuki Yamato. Here is all you need to get started.
Thanks to a patch from Tomas Pokorny, you can now select Oracle user-defined types directly into a Perl object. User-defined types include Object, Varray, and Table. These have been around in Oracle since 8i but have never really gained any sort of popularity for any number or reasons. With the new functionality of DBD::Oracle, selects of these objects are simple to work with in Perl. Lets take the example below for a web site that has a number of different “user” types. Lets have a look.