perl - Redirect "Cant't locate xxx.pm in @INC" message to file -
#!/usr/bin/perl use foo.pm # no such file then run cron, script falls message "can't locate foo.pm in @inc". true. can't see message (server , cron record out of control) , unable detect file missing .
is there way redirect error message log file? stderr redirection doesn't work because error going @ compile time
i tested , following solution work:
./test.pl &> log cat log can't locate foo.pm in @inc (@inc contains: /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 .) @ ./test.pl line 2. begin failed--compilation aborted @ ./test.pl line 2.
Comments
Post a Comment