frisco
January 23rd, 2004, 13:58
I have a perl script with the following in the top:
[code:1:093a135c60]
#!/usr/bin/perl -w
use strict;
use DBI;
use Unix::Syslog qw(:subs);
use Sys::Hostname;
push @INC, '/home/frisco/bin';
use local::sqlpass;
[/code:1:093a135c60]
Note the last two lines.
If i run this script from the command line, it works fine. If i run it via:
[code:1:093a135c60]
/bin/sh -c /home/frisco/bin/xmms-di
[/code:1:093a135c60]
Then i get this error:
[code:1:093a135c60]
Can't locate local/sqlpass.pm in @INC (@INC contains: /usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl .) at /home/frisco/bin/xmms-di line 9.
BEGIN failed--compilation aborted at /home/frisco/bin/xmms-di line 9.
[/code:1:093a135c60]
I want to run this script via an xmms plugin which calls external programs by using '/bin/sh -c' but can't figure out what the difference is between the two methods. The problem must lie in not calling perl from an interactive shell, but i'm not sure why. Any ideas?
[code:1:093a135c60]
#!/usr/bin/perl -w
use strict;
use DBI;
use Unix::Syslog qw(:subs);
use Sys::Hostname;
push @INC, '/home/frisco/bin';
use local::sqlpass;
[/code:1:093a135c60]
Note the last two lines.
If i run this script from the command line, it works fine. If i run it via:
[code:1:093a135c60]
/bin/sh -c /home/frisco/bin/xmms-di
[/code:1:093a135c60]
Then i get this error:
[code:1:093a135c60]
Can't locate local/sqlpass.pm in @INC (@INC contains: /usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl .) at /home/frisco/bin/xmms-di line 9.
BEGIN failed--compilation aborted at /home/frisco/bin/xmms-di line 9.
[/code:1:093a135c60]
I want to run this script via an xmms plugin which calls external programs by using '/bin/sh -c' but can't figure out what the difference is between the two methods. The problem must lie in not calling perl from an interactive shell, but i'm not sure why. Any ideas?