in reply to Re: Regex Substitution in sub
in thread Regex Substitution in sub

I read today in everyone's favourite module:

$toencode =~ s{&}{&amp;}gso; $toencode =~ s{<}{&lt;}gso; $toencode =~ s{>}{&gt;}gso; $toencode =~ s{"}{&quot;}gso; my $latin = uc $self->{'.charset'} eq 'ISO-8859-1' || uc $self->{'.charset'} eq 'WINDOWS-1252'; if ($latin) { # bug in some browsers $toencode =~ s{'}{&#39;}gso; $toencode =~ s{\x8b}{&#8249;}gso; $toencode =~ s{\x9b}{&#8250;}gso; if (defined $newlinestoo && $newlinestoo) { $toencode =~ s{\012}{&#10;}gso; $toencode =~ s{\015}{&#13;}gso; } } return $toencode;
This is the heavy strictless module that everyone still recommends. /o? /s? WHY?!

Can we please stop using and recommending CGI.pm now? Please?

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re^3: Regex Substitution in sub (getting away from CGI.pm)
by Aristotle (Chancellor) on Jun 04, 2003 at 23:46 UTC
    Quoting myself from Re^3: Handy dandy CPAN pollution:
    I've poured over CGI myself. Basically, that module is a horrible mess. That's ok for someone who wants to use it, as it's not only one of the few messes that work, but one of the even fewer than work well in practice.
    I don't really like the module, but we need a good replacement. I was switching to CGI::Simple for a while (as I wrote there), but have now actually found CGI's HTML generation useful in combination with Template Toolkit, so I'm reluctantly back to it. We need a full replacement for all of the functionality of that mess before we can stop recommending it.. :-/

    Makeshifts last the longest.

      We need a full replacement for all of the functionality of that mess before we can stop recommending it.. :-/

      CGI stuff (Form parsing, header sending, uploads, etc...)
      CGI::Simple
      Tag generation
      HTML::EasyTags
      Am I forgetting something?

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }