http://www.perlmonks.org?node_id=100400


in reply to Re: Re: Re: Re: Best way to generate URLs in CGI script?
in thread Best way to generate URLs in CGI script?

No you don't. You want to generate
<img src="graph?channel=1&amp;xsize=300&amp;ysize=400">
This is HTML, so HTML entities must be escaped. The code is somewhat simple (typing this from memory, so be kind if I've made a mistake):
use URI; use HTML::Entities; my $uri = URI->new("graph", "http"); $uri->query_form(channel => 1, xsize => 300, ysize => 400); print "<img src=\"", encode_entities($uri->as_string), "\">";

-- Randal L. Schwartz, Perl hacker