Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Standard method for documenting AUTOLOAD methods in pod

by Anonymous Monk
on Sep 02, 2019 at 23:55 UTC ( #11105488=note: print w/replies, xml ) Need Help??


in reply to Standard method for documenting AUTOLOAD methods in pod

Hi,

Simply give an example the clever way knowing what you know ;)

=head3 get_FILE_CLASSIFICATION_files() =head3 get_PHOTOS_files() =head3 get_ANIMALS_files() =head3 get_BEARDS_files() =head3 get_BEARDS_files( \%Options )

But, why AUTOLOAD ? I thought AUTOLOAD was obsolete in favor of code generation ..

Replies are listed 'Best First'.
Re^2: Standard method for documenting AUTOLOAD methods in pod
by nysus (Vicar) on Sep 03, 2019 at 00:39 UTC

    Dunno. No one told me it was obsolete. It's still in the Perl code base. I don't know anything about automatic code generation.

    So user all uppercase as a placeholder is the standard method?

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

      AUTOLOAD is not obsolete, especially if you're using it for generally "unknown" methods. The "usual" implementation of an AUTOLOAD subroutine then generates and installs the code (well, subroutine) to handle the specific case:

      sub AUTOLOAD { my $method = $AUTOLOAD; my $handler = sub { ... }; # Install the handler: no strict 'refs'; *{ $method } = $handler; goto &$handler; }

        OK, good to know. But how I properly document in my POD? Is there a standard practice for this? The methods are dictated by the user who is using his own custom classes so there is no way for me to know what these methods are going to be actually named.

        $PM = "Perl Monk's";
        $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
        $nysus = $PM . ' ' . $MCF;
        Click here if you love Perl Monks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11105488]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2019-10-23 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?