in reply to escapeHTML & scalar/array context

You could always just change the way you feed escapeHTML, without any sort of wonky join:
map {print $q->escapeHTML($_)} Data::Dumper::Dumper($foo,$bar);
Is that more of what you are looking for? It's a "clean" output of the answer, sans string munching.

    --jb

Replies are listed 'Best First'.
Re: Re: escapeHTML & scalar/array context
by Juerd (Abbot) on Jul 11, 2002 at 10:16 UTC

    map {print $q->escapeHTML($_)} Data::Dumper::Dumper($foo,$bar);

    map in void context is evil. Use map to generate a list, not to just loop over something. Use the for modifier for that.

    print $q->escapeHTML($_) for Data::Dumper::Dumper($foo, $bar);
    Or use map the way it is supposed to be used:
    print map $q->escapeHTML($_), Data::Dumper::Dumper($foo, $bar); print map { $q->escapeHTML($_) } Data::Dumper::Dumper($foo, $bar);
    (The blockless version is shorter and faster.)

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.