Paul Kraus wrote:
> List correct me if I am wrong but you can use single quotes here
> because your not using any variables. You are passing exactly what
> you see. In fact this is the preferred way to write strings that do
> not contain variables or special characters. Correct?
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> zentara Sent: Monday, June 02, 2003 3:20 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Calling a perl script from another perl script
>
>
> On Mon, 2 Jun 2003 14:21:37 +0100 (WEST), [EMAIL PROTECTED] (Jo�o
> lu�s bonina) wrote:
>
> > Well, I've tried the system function, but it isn't executing the
> > script
>
> > which is located in the same directory...
> >
> > I'm using it this way :
> > system('sendfile.pl ons4jlb');
>
> If you havn't found an answer yet, it looks to me like
> you have an error with single quotes around 'sendfile.pl ons4jlb'
>
> It should be like this:
> system('sendfile.pl' , 'ons4jlb') the (command , @args)
The two are equivalent given the data supplied.
from perldoc -f system:
system LIST
system PROGRAM LIST
Does exactly the same thing as "exec LIST", except that a
fork
is done first, and the parent process waits for the child
pro-
cess to complete. Note that argument processing varies
depend-
ing on the number of arguments. If there is more than one
argument in LIST, or if LIST is an array with more than one
value, starts the program given by the first element of the
list with arguments given by the rest of the list. If there
is
only one scalar argument, the argument is checked for shell
metacharacters, and if there are any, the entire argument is
passed to the system's command shell for parsing (this is
"/bin/sh -c" on Unix platforms, but varies on other
platforms).
If there are no shell metacharacters in the argument, it is
split into words and passed directly to "execvp", which is
more
efficient.
Since system('sendfile.pl ons4jlb') has only one scalar argument, it is
checked for shell metacharacters. There aren't any, so the argument is split
on words and passed to execvp.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]