in reply to difference bteween using back quote and sytem command in perl programming

Backquotes return whatever the called program printed to STDOUT. System returns just the exit status.

Your examples don't do anything with the return value. If that's intended, system should be preferred. You can check for errors in either function by looking at $? , the CHILD_ERROR variable.

After Compline,
Zaxo

  • Comment on Re: difference bteween using back quote and sytem command in perl programming

Replies are listed 'Best First'.
Re^2: difference bteween using back quote and sytem command in perl programming
by bigearsbilly (Novice) on Mar 28, 2007 at 14:39 UTC
    Yes, the handy thing with qx// is you can save the output to an array of lines @L = qx(cksum *);

    print pack "H*", "6772656574696e67730a"