Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Using can With Inheritance

by btrott (Parson)
on Apr 18, 2000 at 22:07 UTC ( #7940=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        can(METHOD)
    
        can checks to see if its object has a method called METHOD. If it 
    +does
        then a reference to the sub is returned; if it does not then undef
    + is
        returned.
    
  2. or download this
        package A;
    
    ...
            my $self = shift;
            return $self->can("_write_file");
        }
    
  3. or download this
        package A::B;
        use A;
    ...
            my($path, $val, $start) = @_;
            # ...
        }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://7940]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2014-07-30 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls