Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Regex Substitution in sub

by Juerd (Abbot)
on Jun 04, 2003 at 23:36 UTC ( [id://263184]=note: print w/replies, xml ) Need Help??


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' }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-19 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found