my $res= $db->select('SOME SELECT') $my_module-> parse ($res, $something_else); #this is my parse function in the module: my ($resource, $something ) = @_; ... for (my $i=0; $i