All perl objects extend from the UNIVERSAL
module which
is the base class from which all blessed references inherit
You can call can
on the module to test to see if a particular method is implemented in the package.
perl -MExcel::Writer::XLSX -e 'if (Excel::Writer::XLSX->can("set_vba_name")) {print "It can";}';
perl -MExcel::Writer::XLSX -e '$xlsx = Excel::Writer::XLSX->new("/tmp/file"); if ($xlsx->can("add_worksheet")) {print "It can"}';
I'd avoid using version checking, it makes testing and development much harder, but can work in a pinch.
Ultimately, you want a consistent runtime environment, so you could create a makefile that installs all of the dependencies at the version you need.