[Omaha.pm] ignoring undefined subroutines

Terry td3201 at gmail.com
Tue Sep 7 15:33:59 CDT 2004


Thanks Jay, worked fine.  Thinking outside the box with regards to
scripting isn't on my resume for a good reason.

On Tue, 7 Sep 2004 15:26:26 -0500, Jay Hannah <jay at jays.net> wrote:
> 
> Terry wrote:
> > I want to ignore undefined subroutines.  Right now, my collection of
> > text ( not worthy of being called a perl script ) calls subroutines
> > but I want it to NOT die when it comes across a subroutine that is not
> > defined.  How can I do this?   For example:
> >
> > &{"header_$who"};
> >
> > if $who is not defined or contains a goofy value, my script dies, I do
> > not want this.
> 
> use vars qw( $AUTOLOAD );
> &{"header_$who"};
> 
> sub AUTOLOAD {
>     print "No such sub $AUTOLOAD\n";
> }
> 
> HTH,
> 
> j


More information about the Omaha-pm mailing list