Dear Monks
I have looked at AUTOLOAD on the perldocs and found this
If an AUTOLOAD is found, this method is called on behalf of the missing method, setting the package global $AUTOLOAD to be the fully qualified name of the method that was intended to be called.
I've tried this
package mypackage;
use strict;
missingsub('a','b');
sub AUTOLOAD{
my $args = @_; #I'm getting these args.
print $AUTOLOAD; #but this gives me a syntex error
#Global symbol $AUTOLOAD requires explicit pac
+kage name at..
}
Where am I going wrong.
UPDATE$AUTOLOAD is there I can see it in debug but I can only use it with strict off it seems
20040910 Edit by broquaint: Changed title from 'AUTOLOAD not doing what I expected'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.