only prints $foo, because escapeHTML is expecting a string, and Dumper returns a list. So I use:# $q is CGI object # $foo and $ bar are hash references print $q->escapeHTML(Data::Dumper::Dumper($foo,$bar));
and I think it's a bit ugly - ie, non intuitive. So, does anyone think escapeHTML should be amended in CGI.pm so that if you send it an array, it escapes all elements rather than just the first (and returns an array rather than a string)?print $q->escapeHTML(join '', Data::Dumper::Dumper($foo,$bar));
I just got a little perlexed - and I was bored enough to think about it a little... :)
.02
cLive ;-)
--
seek(JOB,$$LA,0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: escapeHTML & scalar/array context
by Abigail-II (Bishop) on Jul 11, 2002 at 09:22 UTC | |
|
Re: escapeHTML & scalar/array context
by JayBonci (Curate) on Jul 11, 2002 at 08:14 UTC | |
by Juerd (Abbot) on Jul 11, 2002 at 10:16 UTC | |
|
Re: escapeHTML & scalar/array context
by Chmrr (Vicar) on Jul 11, 2002 at 17:36 UTC | |
by Aristotle (Chancellor) on Jul 11, 2002 at 19:27 UTC |