Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 surveying the Monastery: (13)
As of 2014-12-19 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (90 votes), past polls