Do you use the URI module? If you do, then your problems is that the value return by $uri->path doesn't contain the query parameters.
Take a look at the simple test:
use URI;
my $uri = URI->new("http://localhost/test.html?test=1");
print $uri->path . "\n";