[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] uppercasing some things in complex nested structures



On Jan 31, 2009, at 8:40 AM, Dan Linder wrote:
On Fri, Jan 30, 2009 at 1:40 PM, Travis McArthur <travis@travisbsd.org> wrote:
  if (ref($qualifiers) eq "HASH")
...
  elsif (ref($qualifiers) eq "ARRAY")

I just started working on some recursive code and was forced to use the "UNIVERSAL::isa" subroutine to check if an object is a hash or array.

You couldn't use ref?  (perldoc -f ref)

This looks cleaner, but is it available in the older Perl 5.8.0? This looks a lot like the Perl 5.10 code I saw demo'ed and thought "Wow, very nice!"...

I think ref has been in Perl 5... forever. I'm guessing very old Perl 5's will run that code just fine. :)

j