pg has asked for the wisdom of the Perl Monks concerning the following question:
It works. I checked the Math::Complex module, the overloaded “+” actually calls this 'plus' function. Now, is it not normal for me to expect that, the following should work?use Math::Complex; print "plus is supported\n" if (Math::Complex->can("plus"));
But it does not, even though “+” is overloaded for this class. My question is:use Math::Complex; print "+ is supported\n" if (Math::Complex->can("+"));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 'can' operator?
by broquaint (Abbot) on Nov 18, 2002 at 18:14 UTC | |
|
Re: 'can' operator?
by Zaxo (Archbishop) on Nov 18, 2002 at 20:33 UTC |