in reply to dynamic methods with variables

You need to drop the qw() and change $parameters to an array e.g
my @parameters = (colorspace = >'gray', compression = >'none');
Because as it stood $parameters was being assigned compression=>'none' as your code really looked like this
my $parameters = (q[colorspace=>'gray'], q[compression=>'none']);
See. perlop for more info on the workings of qw().
HTH

_________
broquaint