What you want to run on the 5.10.1 system is:
perldoc perldelta
This will tell you the differences between the current perl and
previous versions.
Most likely the code is doing something iffy or unsupported. Perhaps
you have a
sub named "say", for example or use the $# variable.
You should also check perl -V output on both systems to see if Perl
was
built with the same options.
The Bio::DB::Sam module source should include test code which can be
run as
part of the build process to verify that it works correctly. How
complete the
test code is depends on the developers of the module, but you may be
able to
add test cases of interest.