Running Perl from one OS to another OS 
Author Message
 Running Perl from one OS to another OS

Hi:

Here's my scenario:
Using Samba. Windows client running a Perl script that physically
resides on the
samba share (which is a Unix sun5 box). The script is called via a UNC
path name.
I want to have the Windows client call, or run directly, another Perl
script on the sun OS platform. Probably be better to have the sun5
script actually called by the win32 script, because the Windows script
will rely heavily on the result of the sun5 Perl
script.

Can this be done? Can I have a Perl script running from a win32 box call
another
Perl script that will need to run on the sun5 box (set up as a samba
share) and then have the original script process the return code/string
from the sun5 script?

Thx a mil in advance.
Joe



Mon, 11 Oct 2004 11:26:26 GMT  
 Running Perl from one OS to another OS

Quote:
> Hi:

> Here's my scenario:
> Using Samba. Windows client running a Perl script that physically
> resides on the
> samba share (which is a Unix sun5 box). The script is called via a UNC
> path name.
> I want to have the Windows client call, or run directly, another Perl
> script on the sun OS platform. Probably be better to have the sun5
> script actually called by the win32 script, because the Windows script
> will rely heavily on the result of the sun5 Perl
> script.

> Can this be done? Can I have a Perl script running from a win32 box call
> another
> Perl script that will need to run on the sun5 box (set up as a samba
> share) and then have the original script process the return code/string
> from the sun5 script?

> Thx a mil in advance.
> Joe

1) Does the other script have to be run under Solaris?
2) Maybe you could use rsh (Remote SHell) [I've never used it so I
don't know anything about it]
3) Though far from ideal, maybe you could use flag files and cron:
Windows script creates data file, script on sun5 is launched by cron
every minute (that is the bad part) and processes the data file if it
exists and then the Windows script reads the processed file. As cron
is only launched every minute, it could take up to just over a minute
from the Windows script creating the data file until it gets the
processed data back.


Mon, 11 Oct 2004 18:04:03 GMT  
 Running Perl from one OS to another OS
Damien:

Quote:
>> 1) Does the other script have to be run under Solaris?

It's not that it has to be Solaris - the sun box has access to the resource
I need (Oracle). I do not want to install SQLnet on all the client machines
when I can get what I need from the solaris box.

2) Maybe you could use rsh (Remote SHell) [I've never used it so I
don't know anything about it]

I tried using the MKS toolkit's "rsh", but no luck so far. I'm going to continue
investigating.

3) Though far from ideal, maybe you could use flag files and cron:
Windows script creates data file, script on sun5 is launched by cron
every minute (that is the bad part) ....

That is a good idea, but - you're right - it is very messy. Will use it as a
last resort - maybe...

I really appreciate your input on this.
Joe

Quote:


> > Hi:

> > Here's my scenario:
> > Using Samba. Windows client running a Perl script that physically
> > resides on the
> > samba share (which is a Unix sun5 box). The script is called via a UNC
> > path name.
> > I want to have the Windows client call, or run directly, another Perl
> > script on the sun OS platform. Probably be better to have the sun5
> > script actually called by the win32 script, because the Windows script
> > will rely heavily on the result of the sun5 Perl
> > script.

> > Can this be done? Can I have a Perl script running from a win32 box call
> > another
> > Perl script that will need to run on the sun5 box (set up as a samba
> > share) and then have the original script process the return code/string
> > from the sun5 script?

> > Thx a mil in advance.
> > Joe



Tue, 12 Oct 2004 06:19:07 GMT  
 Running Perl from one OS to another OS

Quote:
> Damien:

> >> 1) Does the other script have to be run under Solaris?

> It's not that it has to be Solaris - the sun box has access to the resource
> I need (Oracle). I do not want to install SQLnet on all the client machines
> when I can get what I need from the solaris box.

> 2) Maybe you could use rsh (Remote SHell) [I've never used it so I
> don't know anything about it]

> I tried using the MKS toolkit's "rsh", but no luck so far. I'm going to continue
> investigating.

> 3) Though far from ideal, maybe you could use flag files and cron:
> Windows script creates data file, script on sun5 is launched by cron
> every minute (that is the bad part) ....

> That is a good idea, but - you're right - it is very messy. Will use it as a
> last resort - maybe...

> I really appreciate your input on this.
> Joe



> > > Hi:

> > > Here's my scenario:
> > > Using Samba. Windows client running a Perl script that physically
> > > resides on the
> > > samba share (which is a Unix sun5 box). The script is called via a UNC
> > > path name.
> > > I want to have the Windows client call, or run directly, another Perl
> > > script on the sun OS platform. Probably be better to have the sun5
> > > script actually called by the win32 script, because the Windows script
> > > will rely heavily on the result of the sun5 Perl
> > > script.

> > > Can this be done? Can I have a Perl script running from a win32 box call
> > > another
> > > Perl script that will need to run on the sun5 box (set up as a samba
> > > share) and then have the original script process the return code/string
> > > from the sun5 script?

> > > Thx a mil in advance.
> > > Joe

> I do not want to install SQLnet on all the client machines

Installing the client may be the best way.

Maybe you could (I'm being roundabout here because you don't want to
take the easy option of installing the client) install a web server
and write a CGI script that would accept SQL statements and return the
results.

Perl could probably just use LWP::Simple to call the CGI and get the
results.



Tue, 12 Oct 2004 18:45:24 GMT  
 Running Perl from one OS to another OS
Michel/Damien:

First I must apologize for not providing all the info I should have:
1. The application primarily involved here is ClearCase; Perl is included with the
ClearCase installation on the client. I don't know if you've done support, but my
reason for not wanting to load anything on the client is purely from a support
angle - I don't/can't solve the problem by adding more applications (to support)
on the client side. It's difficult enough to verify that ClearCase was loaded and
configured properly; adding another application is out of the question.Especially
one that require some sort of setup; got to make it as easy and straightforward
for the clients as possible.

2. I am a Perl neophyte; I'm learning as fast as I can, but I don't know anything
about #1
and #3 in Michel's email (know a little about CGI scripts).

Are "DBD::Proxy" and "SOAP::Lite" part of a standard Perl install or are they modules
I
have to dig up somewhere? Where can I get more info about them?

Lastly, thanks a lot for both of your responses - they have been very helpful -
especially
the "rexec" info. That might've worked but it behaves differently on NT4 and 2000.
In NT4, rexec will allow you to use one, non-interactive command line to run a remote
script/binary. W2000 is interactive and prompts you for the user password.

Joe

Quote:


> >Damien:

> >>> 1) Does the other script have to be run under Solaris?

> >It's not that it has to be Solaris - the sun box has access to the resource
> >I need (Oracle). I do not want to install SQLnet on all the client machines
> >when I can get what I need from the solaris box.

> So you have Perl installed on your Windows clients, but you don't want to
> install DBD::Oracle (and possibly some additional required *net stuff from
> Oracle) on them, right ?

> Here are three other ways of achieving that :

> a. use DBD::Proxy on the Windows side, and DBI::ProxyServer on the
> Sun side to actually handle the requests with Oracle
> b. use a web server and some CGI script on the Sun side to handle the
> requests, and use LWP::Simple and get() to retrieve the information on
> the Windows side
> c. use SOAP::Lite, as client on the Windows side and as server on the
> Sun side, to handle remore requests

> There's a bunch of other ways you could remotely execute some script,
> but those are probably the "easiest" ones (besides a plain rexec batch
> file). Of course, it all depends on how often this will be executed, what
> kind of error recovery and roll-back you want to support, how much
> data needs to be exchanged between clients and server, and so on...

> Have fun,

> Michel.



Wed, 13 Oct 2004 08:26:36 GMT  
 Running Perl from one OS to another OS

Quote:
> Can this be done? Can I have a Perl script running from a win32 box call
> another
> Perl script that will need to run on the sun5 box (set up as a samba
> share) and then have the original script process the return code/string
> from the sun5 script?

If I followed you correctly, you want one script to run another.  The
easy way is to do something like ...

#somewhere within your first script
system("second_script.pl");
-or- perhaps ....
#somewhere in your first script

close PIPE;
#process what you got from the second script

But, you did mention some type of dependance between the two, so ...
I'm not sure if this will work for you.

We have a couple of scripts that are called from a Windows client to a
SunOS box, but Perl is installed on the client - so, the solution may
not apply.  The solution we used was to use Net::Telnet.  So, the
Windows client telnets (via Perl) to the SunOS box and issues the
command to run the script (on the SunOS box).  But, the same type of
senerio may be played out using a batch file on the Windows client
versus installing Perl on it.

I hope I followed and this helps.

Jim



Sun, 17 Oct 2004 12:15:40 GMT  
 Running Perl from one OS to another OS

Quote:
>> Can this be done? Can I have a Perl script running from a win32 box call
>> another
>> Perl script that will need to run on the sun5 box (set up as a samba
>> share) and then have the original script process the return code/string
>> from the sun5 script?

You can call the second script via HTTP using the LWP library, capture its
output and extract the information you need from that. Not the most elegant way
but it does work.

Dan O.



Thu, 28 Oct 2004 02:36:47 GMT  
 Running Perl from one OS to another OS

Quote:
> Hi:

...

Quote:
> Can this be done? Can I have a Perl script running from a win32 box call
> another
> Perl script that will need to run on the sun5 box (set up as a samba
> share) and then have the original script process the return code/string
> from the sun5 script?

Hi,

do check the %ENV variable in your script.
Call the script from the window client and check the value for
HOSTNAME and the like. If they point to Windows you will have
to use some sort of connecting to the sun server (rsh, ssh ,
telnet ...). If the enviroment variable points to sun (which i
doubt) you can adress the the filesystem of the sun server directly,

hope this helps
sake.

Quote:

> Thx a mil in advance.
> Joe



Tue, 02 Nov 2004 17:03:05 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Segmented Mac OS X dev tools (was: Yet another gcc on Mac OS X posting)

2. Starting Perl on more than one OS

3. Perl running under IBM OS

4. Run perl script under Mac OS X

5. Perl on OS/2, can't run it

6. Help request: Running perl under OS/2

7. Problems running .cmd and .exe from Perl for OS/2

8. Running a DOS-command under perl for OS/2

9. reading Dbase, perl script runs (OS/2) yet snagged at byte 150h under UNIX

10. Which Win32 OS am I running?

11. [Fwd: Can a Series of Scripts Run an OS Out of Memory]

12. Perl for OS/2: DLL callouts; Perl 5

 

 
Powered by phpBB® Forum Software