[Israel.pm] Running SQLplus within perl

Jason Friedman jason.friedman at weizmann.ac.il
Wed Oct 13 06:42:39 PDT 2004


> However, if I try to run it via rsh - i.e. rsh host -l username "./topscript.pl" then the SQL does not run.

I think that in general the current directory is NOT preserved when you
run via rsh, so you will need to first change to the current directory
(assuming you have a shared home directory across the two machines). I
do something like this:

use Cwd;  
my $cwd = cwd;  
my $commandline = "rsh $remotecomputer \"cd $cwd;someprogram\"";
system($commandline) == 0
   or die "system $commandline failed :$?";

Anyway, does it work if you run it not inside perl?

Jason

> 
> So my questions are thus:
> 
> 1. Why ?
> 2. Is there a better way of using the perl to run SQL plus rather than the systemcommand ?
> 
> Best Regards,
> 
> Mark Prager
> I & T Engineer, Project Delivery
> Binyan Mercazim, Room 514
> NDS Technologies Israel Ltd.
> 
> 




More information about the Perl mailing list