Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

A working strategy to handle AUTOLOAD, can(), and (multiple) inheritance without touching UNIVERSAL?

by lodin (Hermit)
on Aug 29, 2009 at 16:58 UTC ( #792087=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
        package Foo;
    ...
        # autoloads foo()
        # autoloads bar()
    }
    
  2. or download this
        my $code = $obj->can('foo');
        $obj->$code(...)
    
  3. or download this
        $obj->foo(...)
    
  4. or download this
        AUTOLOAD {
            ...;
    ...
                croak("No method $method ...");
            }
        }
    
  5. or download this
        AUTOLOAD {
            ...;
    ...
                croak("No method $method ...");
            }
        }
    
  6. or download this
        AUTOLOAD {
            my $self = $_[0]; # Not shift, using goto.
    ...
                croak(...);
            }
        }
    
  7. or download this
        sub can {
            my ($self, $method) = @_; # Not shift, using goto.
    ...
    
            return $universal; # May be undefined.
        }
    
  8. or download this
        use Class::AUTOCAN sub {
            my $self = shift;
    ...
    
            return;
        };
    
  9. or download this
        Class::AUTOCAN->install(
            target => $pkg,
            code => sub { ... },
        );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://792087]
Front-paged by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-12-22 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (112 votes), past polls