Can another Perl script without using exec or system

G

Great Deals

I don't have shell access from the hosting company, so I cannot use
exec or system, but I need to run several perl scripts at once. So in
a pure perl enviroment, totally indepentent from shell/os, how can I
call other perl scripts from another perl script? use, include, ...?
 
S

Sam Holden

I don't have shell access from the hosting company, so I cannot use
exec or system, but I need to run several perl scripts at once. So in
a pure perl enviroment, totally indepentent from shell/os, how can I
call other perl scripts from another perl script? use, include, ...?

Not having shell access isn't going to stop you using exec or system
in a perl script. It just stops you logging into the machine and
getting a command prompt.

perldoc -f do

Of course the scripts probably wont work unchanged anyway, since
their environments will be different then when run seperately at
the command line.
 
J

James Willmore

On 30 Sep 2003 20:50:54 -0700
I don't have shell access from the hosting company, so I cannot use
exec or system, but I need to run several perl scripts at once. So
in a pure perl enviroment, totally indepentent from shell/os, how
can I call other perl scripts from another perl script? use,
include, ...?

perldoc perlboot
perldoc perltoot
perldoc perlbot
perldoc perlmod
perldoc -f require
perldoc -f do

Take your pick :)

You may also consider learning portable Perl. Meaning, learn to code
in Perl _without_ calling out to a shell. _Most_, if not all actions
you can perform at the shell you can do within Perl. Not to mention -
_if_ you decide to change platforms (ex you change web hosts - you go
from a Windows host to a Linux host), you won't have to alter your
code at all -or- it will be minimal.

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
Excellent day for drinking heavily. Spike office water cooler.
 
T

Tad McClellan

James Willmore said:
On 30 Sep 2003 20:50:54 -0700


Your (the OP's) conclusion has no relationship to your hypothesis.

system() and backticks should work fine in your Perl programs,
regardless of whether you also have shell access or not.

Have you tried using system() already?

What happened when you tried it?


Are we working on a problem that does not even exist?

perldoc perlboot
perldoc perltoot
perldoc perlbot
perldoc perlmod


I see nothing in the problem description that implies that objects
nor modules would be particularly helpful for this task.

Take your pick :)


(but don't pick any of the first four :)

You may also consider learning portable Perl.


That part is generally good advice though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top