URI::GoogleChart will pass $type through to the final URL, invalid chart types will cause Google to choke, eg.

my $var = GoogleChart->new("fred", 300, 100, data => [45, 80, 99, 33]);

produces

http://chart.apis.google.com/chart?cht=fred&chs=300x100&chd=t:18.2,71.2,100,0

To prevent users from passing an invalid chart type, I added this to the
beginning of new()

croak("Unsupported chart type") unless (grep /^$type$/, %TYPE_ALIAS);


--Jeff

"You cannot unsay a cruel word." - Unknown

Reply via email to