Changes to get this to compile and create valid looking perl calls

Also changes to Perl script to pass in and use bundle dir and bundle
version
Changes to Perl script and fix for scalar number of arguments