I created a simple talend perl job to extract data from an excel file and place it in a mysql table.
This works fine when I run it in talend studio 4.1.1.
The problem is when I export the job. I try to run it like so:
perl -Ilib
proj.job_import_prods_0.1.pl
–context=Default –context_param file_path=”/home/antoniocs/programming/file.xls”
$*
This gives me the following errors:
Can’t locate IO/Scalar.pm in @INC
(@INC contains:
/home/antoniocs/programming/ lib
/etc/perl /usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1
/usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl .) at
lib/OLE/Storage_Lite.pm line 171.
BEGIN failed–compilation aborted at
lib/OLE/Storage_Lite.pm line 171.
Compilation failed in require at
lib/Spreadsheet/ParseExcel.pm line 18.
BEGIN failed–compilation aborted at
lib/Spreadsheet/ParseExcel.pm line 18.
Compilation failed in require at
proj.job_import_prods_0.1.pl line 568.
BEGIN failed–compilation aborted at
proj.job_import_prods_0.1.pl line 568.
I have already placed the ParseExcel.pm int the lib folder in the folder of the job. Is there no way talend will automatically add the necessary files to the job’s folder?
NOTE: When exporting the job I checked the box “export dependencies”
EXTRA NOTE: I am not a perl programmer.
You need to find the path where
talendstores Perl modules (you cant just move files around). Once you know that, you can create aPERL5LIBenvironment variable to tellperlwhere the modules it is looking for are stored:A quick
find /where/talend/lives -name Scalar.pmshould give you a clue (you want the directory beforeIO). If you wind up needing multiple directories, they can be separated with a:just like in thePATHenvironment variable.Alternatively, you can install the required modules from your package manager (hint, RedHat style boxes use names like perl-IO-Scalar and Debian style boxes use names like libio-scalar-perl) or CPAN.