Yuri
Are you doing this in order to effect duck-typing? If so, you may want to
consider applying the attributes with a Role, and using this idiom:
if ($obj->does('fooer')) {}
Cheers
On 09/09/2009 9:26am, Yuri Shtil <yu...@juniper.net> wrote:
What is the right way to see if an object has certain attribute?
I tried
if $obj->can('foo') {}
but got burned when something like 'import/export' gets in a way.
Do I have to maintain the list of attributes (an another attribute !!!)
as I create them?
--
Yuri