On Apr 6, 7:45 am, paik...@gmail.com (Dermot) wrote: > Hello All, > > I have a issue when I attempt to run a script on one host (B) that is > called by ssh from other host (A). > > On host B, I have the script in /usr/local/bin/stuff.pl. The script > has the following near the top: > > use strict; > use warnings; > use lib qw(/etc/perl); > > use MyApp::Image; > use MyApp::Schema; # Schema will attempt to dbi:SQLite connect to a > local db file. > ... > ... > ... > > On host A I run a script that does: > > use FindBin qw($Bin); > use lib qq($Bin/../lib); > ... > ... > ... > my $cmd = qq(ssh -i $Bin/../lib/.ssh/someuser_id.rsa someuser\@) . > $self->config('imageing_server') . > qq( "/usr/local/bin/stuff.pl "); > my $res = qx($cmd); > > When I run the script, I get: > Can't locate MyApp/Schema.pm in @INC (@INC contains: > /usr/local/bin/../../ /etc/perl > /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi > /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl > /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi > /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl > /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) > at /usr/local/bin/stuff.pl line 15. > > The @INC mentioned in the error looks like the @INC on host A, or at > least perl is looking for the files locally. I fear that, worse than > simply having problem with @INC, other paths, including the path to > local files will try and reference stuff on host A and not host B. > There may be some very good security reasons for this (perldoc > perlsec) but I hoping there is a way to make this work. > > Does anyone know if or how I can make the script on host B execute > it's commands and look locally for files?
How's the script on host B invoked... standalone via shebang line or externally as in 'perl stuff.pl'? If the latter, is the invoking perl distro identical with that on the shebang line? -- Charles DeRykus -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/