develooper Front page | perl.perl5.porters | Postings from July 2003

exists OBJ_or_CLASS->methodname

Thread Next
From:
Jeff 'japhy' Pinyan
Date:
July 21, 2003 14:35
Subject:
exists OBJ_or_CLASS->methodname
Message ID:
Pine.LNX.4.44.0307211733560.21542-100000@perlmonk.org
Someone on irc.freenode.net #perl asked why

  exists $obj->method

didn't "work" as he intended.  I explained that $obj->can('method') was
the right approach there.  Is it possible that exists() might be more
DWIM-ish, and when given

  exists THING->method

could act like

  THING->can('method')

I think it might be useful; but maybe that's overloading exists() more
than people would like.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About