Skip Menu |

This queue is for tickets about the Data-Walk CPAN distribution.

Report information
The Basics
Id: 18206
Status: resolved
Priority: 0/
Queue: Data-Walk

People
Owner: GUIDO [...] cpan.org
Requestors: jpierce [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.02
Fixed in: (no value)



Subject: Type determination
The current code does things like: if ($item =~ /(HASH|ARRAY)\(0x[0-9a-f]+\)$/) { It's generally better to use ref() than to rely upon stringification (and the regexp engine) to determine a reference's type.
From: guido [...] imperia.net
On Thu Mar 16 11:16:45 2006, JPIERCE wrote: Show quoted text
> The current code does things like: > > if ($item =~ /(HASH|ARRAY)\(0x[0-9a-f]+\)$/) { > > It's generally better to use ref() than to rely upon stringification > (and the regexp engine) to determine a reference's type.
I can't use ref() here because it will
Sorry for the truncated first reply. No, ref() will not return the information I need for blessed objects. I have to find out the base type. There is a function in some CPAN module that provides this information, too, but it also boils down to a pattern match on the stringification. Regards, Guido
After some investigation in your code (Data::JavaScript) I found out that UNIVERSAL::isa() is actually my friend here. The idea never came to muse y mind. ;-) I will use your method in the next version. It is a lot better than mine. Regards, Guido