sub identify { my $token = shift; my $q = shift; # and including this element on the sub call, of course my $q = new CGI; # it started working when I removed this line! # identification routines # some calls to CGI.pm methods, where I used $q }