Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Script Stripper

by Juerd (Abbot)
on Dec 26, 2001 at 03:37 UTC ( #134323=note: print w/ replies, xml ) Need Help??


in reply to Script Stripper

@foo{ qw/a b c/ }++ on an empty %foo, will have $foo{a} be 1 and $foo{b} and $foo{c} be undef. That's no problem, because it's only being used for exists. You can have $foo{a} be undef too, by assigning an empty list to the hash splice: @foo{ qw/a b c/ } = ()

By the way, think about these:

<style> span.blah { background-color: expression(alert('Hello, World!' +)) } </style> <a href="javascript:alert('Hello, World!');">hi mom</a> <img src="fourohfour" onerror="alert('Hello, World!');">
It may be better to define what IS allowed, instead of what's NOT. HTML changes continuously, and browsers don't always follow specs...

For the quotes: just use HTML::Entities, and have it change double quotes to &quot;, zo you can safely use double quotes.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$


Comment on Re: Script Stripper
Select or Download Code
Re: Re: Script Stripper
by japhy (Canon) on Dec 26, 2001 at 09:58 UTC
    Long live Perl 6.
    %hash{qw(a b c)} ^= 1; # or maybe... %hash{qw(a b c)}^++;

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      Perl6 will indeed be great. But undef values are sufficient in this case ;)

      2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2015-07-05 03:21 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 (60 votes), past polls