Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Security techniques every programmer should know

by Juerd (Abbot)
on Dec 26, 2004 at 22:47 UTC ( #417490=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Encode qw(decode);
    use URI::Escape qw(uri_unescape);
    my $string = decode 'utf-8' => uri_unescape $input;
    
  2. or download this
    use Encode qw(encode);
    use HTML::Entities qw(encode_entities);
    my $output = encode_entities encode 'utf-8' => $string;
    
  3. or download this
    #!/usr/bin/perl -w
    
    ...
    
    print "Content-Type: text/html\n\n";
    print read_file "$page.html";
    
  4. or download this
    http://example.com/page.cgi?page=page.cgi%00blah!
    
  5. or download this
    $string =~ tr/\x00-\x09\x0b\x0c\x0e-\x1f//d;
    
  6. or download this
    #!/usr/bin/perl -wT
    
    ...
    
    print "Content-Type: text/html\n\n";
    print read_file "$page.html";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://417490]
Approved by talexb
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (18)
As of 2015-07-06 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls