Compile /Search/Chart not working


I want to compile the chart GD::Image for latter use like this:

my $chart = $m->comp(’/Search/Chart’, Query => $Query, Console => 1, %ARGS);

And modified code in /Search/Chart like this:

<%METHOD Plot>
$plot => undef
$Console => 0
my @types = (‘png’, ‘gif’);

for my $type (@types) {
or next;

if($Console) { 
    return $plot; 
} else { 
    $m->out( $plot->$type ); 


die "Your GD library appears to support none of the following image types: "
. join(’, ', @types);


I thought that it will return me the GD::Image instance of $plot on
$m->comp(), but I get undefined.
How can I get the the $plot object from /Search/Chart script?


View this message in context: