Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 musing on the Monastery: (9)
As of 2015-07-07 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls