#! /usr/bin/perl -w use strict; print "NOT LOADED\n" unless FOO->can('bar'); FOO->bar(); print "NOW LOADED\n" if FOO->can('bar'); package FOO; use vars '$AUTOLOAD'; sub AUTOLOAD { no strict "refs"; my $class = shift; print "LOADING $AUTOLOAD\n"; *{$AUTOLOAD} = sub {print "USING CACHED VERSION";}; return }
In reply to Re: Re: AUTOLOAD question
by Lachesis
in thread AUTOLOAD question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |