TIA for any help. I'm new to this site and need help after trying lots of online resolutions. My perl script is getting "Can't locate Unicode/Map.pm" when I run as user XXX but runs OK when run as root.
Here's the pertinent part of the script:
[XXX@n12 p1]$ cat -n xls2csv
1 #!/bin/perl -I/root/perl5/lib/perl5/x86_64-linux-thread-multi
+/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /root/perl5/li
+b/perl5/5.16.3 /usr/local/lib64/perl5
2 use strict;
3 use 5.006;
4
5 use lib '/root/perl5/lib/perl5';
6 use Getopt::Std;
7 use Locale::Recode;
8 use Spreadsheet::ParseExcel;
9 use Spreadsheet::ParseExcel::FmtUnicode;
10 use Text::CSV_XS;
11
And the error:
Can't locate Unicode/Map.pm in @INC (@INC contains: /root/perl5/lib/pe
+rl5 /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/p
+erl5/5.16.3/x86_64-linux-thread-multi /root/perl5/lib/perl5/5.16.3 /u
+sr/local/lib64/perl5 /root/perl5/lib/perl5/x86_64-linux-thread-multi
+/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /root/perl /ho
+me/XXX/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /home/XXX/per
+l5/lib/perl5/5.16.3 /home/XXX/perl5/lib/perl5/x86_64-linux-thread-mul
+ti /home/XXX/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/
+perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/
+lib64/perl5 /usr/share/perl5 .) at /home/XXX/perl5/lib/perl5/Spreadsh
+eet/ParseExcel/FmtUnicode.pm line 22.
BEGIN failed--compilation aborted at /home/XXX/perl5/lib/perl5/Spreads
+heet/ParseExcel/FmtUnicode.pm line 22.
Compilation failed in require at ./xls2csv line 9.
BEGIN failed--compilation aborted at ./xls2csv line 9.
I've matched up XXX's @INC to root's @INC via the "#!/bin/perl -I..." line of the script. It SEEMS the critical directories match up.
Here's root's @INC:
[root@n12 p1]# perl -e "print \"@INC\"" | sed 's/ /\n/g' | sort
.
/root/perl5/lib/perl5
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/usr/lib64/perl5
/usr/lib64/perl5/vendor_perl
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/share/perl5
/usr/share/perl5/vendor_perl
And here's XXX's @INC:
[XXX@n12 p1]$ echo <output from @INC erro> | sed 's/ /\n/g' | sort
/home/XXX/perl5/lib/perl5
/home/XXX/perl5/lib/perl5/5.16.3
/home/XXX/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/home/XXX/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl
/root/perl5/lib/perl5
/root/perl5/lib/perl5/5.16.3
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/root/perl5/lib/perl5/x86_64-linux-thread-multi
/usr/lib64/perl5
/usr/lib64/perl5/vendor_perl
/usr/local/lib64/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/share/perl5
/usr/share/perl5/vendor_perl
I THINK Map.pm is the file that needs to be found in @INC. Here's where it is:
[root@n12 p1]# find / | grep Unicode | grep Map.pm
/root/.cpan/build/Unicode-Map-0.112-Pe4OUJ/Map.pm
/root/.cpan/build/Unicode-Map-0.112-Pe4OUJ/blib/lib/Unicode/Map.pm
/root/perl5/lib/perl5/x86_64-linux-thread-multi/Unicode/Map.pm
Since the .cpan directories are not in root's @INC, I didn't add them to XXX's @INC.
I'm thinking I don't know everything I need to fix this. Can you help?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.