On Tue, Jan 23, 2001 at 02:44:57PM -0800, Todd Caine wrote:
> 
> > You can't just execute shell code from Perl by putting it in backquotes.  
> > You
> > need to use the system command, or do the equivalent functions within Perl.
> 
> That is incorrect.  The backquotes cause the expression to be
> interpolated and then executed as a system command.  The collected
> standard output of the command is returned.

That's correct, and please ignore what I wrote.  I must have been
thinking of something when I wrote that, but I have no idea what.  One
of those days.


> system() on the other hand causes perl to do a fork() and exec(). 
> Now the parent waits for the child to finish are returns with the
> exit status of the program as returned by the wait() call.

Depending on what you are doing, this may be preferable (but probably
not in this case where you're trying to get some result off the
standard output and into a Perl variable.)

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  [EMAIL PROTECTED]
      The named which can be named is not the Eternal named.


--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

Reply via email to