Re: HTML::Element bug
Gisle Aas (gisle@aas.no)
06 Jan 1998 09:53:44 +0100
sswartwo@mcgraw-hill.com writes:
> The following:
>
> use HTML::Element;
>
> my $e = new HTML::Element( 'a',
> 'href' => 'http://cgi-foo/foo.cgi?A=B&C=D' );
>
> print $e->starttag( );
>
> Generates:
>
> <A HREF="http://cgi-foo/foo.cgi?A=B&C=D">
>
> This is a case where I don't want the & encoded...
Why not?
I know, it looks too ugly. With Unicode coming our way there is a
increasing probability that the form key behind a '&' in a query will
be interpreted as an entity.
At some time Netscape even interpreted <a href="foo?foo=bar®ular=1">foo</a>
as <a href="foo?foo=bar&ular=1">foo</a> which was clearly bad. You live
safer is the '&' is encoded.
--
Gisle Aas
<TR>
> <TD>
> " "
--
Gisle Aas
unless $context eq "void";
print "ok 1\n";
$a = context();
print "not " unless $context eq "scalar";
print "ok 2\n";
@a = context();
print "not " unless $context eq "array";
print "ok 3\n";
sub foo { return context(); }
sub bar { foo(); }
bar();
print "not " unless $context eq "void";
print "ok 4\n";
$a = bar();
print "not " unless $context eq "scalar";
print "ok 5\n";
@a = bar();
print "not " unless $context eq "array";
print "ok 6\n";