On Fri, 2002-06-14 at 08:14, Angela Fisher wrote:
> Hi,
> 
> I replaced qx{ ./test.pl -P @ARGV};
> with exec(" ./test.pl -P @ARGV");
> 
> This works.  I'm very new at this so excuse the
> question.  Can "qx{}" be used to execute a command
> or script?  It just looks like a way to quote a string
> to me.
> 
> Angela
> 
<snip />

qx`` is the proper form of `` just like q'' is the proper form of '' or
qq"" for "".  The back ticks issue a fork and exec the command line you
provide sending the stdout back as a list.  So

foreach my $line (`ls -l`) {
        print $line;
}

is equivalent to saying "ls -l" on the command line.  the system
function issues a fork/exec/wait combo that returns the return code from
the program (on most OSes this is -128-127).

The exec function replaces the currently running process with the one
named (hence the fork before the exec in system and qx``). 

See The following resources for more info
perldoc -f system
perldoc -f exec
perldoc -f fork
perldoc -f wait 


-- 
Today is Setting Orange the 19th day of Confusion in the YOLD 3168
This statement is false.

Missile Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to