Sorry if the title is not quite appropriate, i dont even know how to properly name what i am asking.
When using a module in a script, CGI.pm for what im specifically working on, function sets can be imported with a use statement such as:
use CGI qw(:form);
...or other funciton sets, etc
I would like to access a list of what functions were explicitly imported. I have my own class that is derived from CGI.pm, which messes with form param names (among other things), and i want to write an AUTOLOAD into my class that intercepts calls to the :form functions, and do certain things before passing them on to CGI.
This will help me immensely. Unfortunately, i know virtually nothing about the mechanisms used for this sort of thing.
Thanks much
Update:
I cheated in my own way, and created an autoload that doesnt bother checking the method name, but determines what to do by the param list (using named params)
sub AUTOLOAD {
my $self = shift @_;
(my $method = $AUTOLOAD) =~ s/.*:://;
return if $method eq "DESTROY";
if ( ! (@_ % 2) ) {
my %args = @_;
if ( exists($args{-page}) && exists($args{-param}) ) {
# appears to be a form element creation call to CGI
$args{-name} = $self->CreateRawFieldName(-page => $args{
+-page},
-param => $args{
+-param});
delete $args{-page};
delete $args{-param};
my $parent_call = 'SUPER::' . $method;
return $self->$parent_call(%args);
}
}
}
Not exactly what i wanted to do, but it works for my purposes, it just feels unclean.
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.