perl Net::SNMP version getting info from cisco switch

I am having trouble working with SNMP module with perl. I am trying to get SNMP version of target system. I use following code to get it however it resturns error as "Argument "v6.0.1" isn't numeric in numeric lt (<) at ./chk_env_upd.pl line 447."

 Get load table
my $resultat = (Net::SNMP->VERSION < 4) ?
                  $session->get_table($ciscoEnvMonMIB)
                : $session->get_table(Baseoid => $ciscoEnvMonMIB);

Any help is appreciated

Something like this:

% perl -Mstrict -MNet::SNMP -wle'
  ( my $mod_version = Net::SNMP->VERSION ) =~ s/\D+(\d+).*/$1/;
  print $mod_version > 4 ? "OK" : "KO" ;
  '
OK