in reply to CGI.pm: Importing unsupported HTML tags

Update: OK, I just found out that CGI.pm supports an "any" pragma which allows the creation of 'ad hoc' HTML tags.

But, I did not use this pragma (called with "-any") in the code above and yet I can still create these 'ad hoc' tags. Any ideas?

Update to update: OK, it appears that the "-any" pragma is enabled whenever using the ":standard" export tag. When I don't use ":standard", I get an error for an unknown subroutine. According to the CGI.pm documentation, ":standard" in turn calls export tags :html2, :form, and :cgi. I'm guessing it's one of these turns "-any" on. None of this appears to be documented. Does anyone know the ins and outs of all this?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot";
$nysus = $PM . $MCF;

  • Comment on Re: CGI.pm: Importing unsupported HTML tags

Replies are listed 'Best First'.
(tye)Re: CGI.pm: Importing unsupported HTML tags
by tye (Sage) on Jun 17, 2001 at 22:52 UTC

    Without use CGI qw( -any );, then potential typos in method calls are caught, as in:

    $q= CGI->new(); print $q->threader();
    But you don't have to specify "-any" in order to be able to put any function name matching /^\w+\z/ in the export list to use CGI.

    I guess that it is thought that this one place you can be extra careful to avoid typos for the sake of having easy access to custom HTML tags (especially since you'd then have to make the exact same typo in your code for it to not be caught).

    BTW, this has everything to do with CGI.pm-specific magic and nearly nothing to do with the way that "normal" modules export symbols.

            - tye (but my friends call me "Tye")