Hi Mike,

On Sat, 24 Jan 2015 08:13:38 -0600
Mike <ekimduna...@gmail.com> wrote:

> Which is generally considered the best practice way of executing system 
> commands from within a Perl program?
> 
> Should I use backticks or qx//, system(), or exec()?
> 
> Or is there no "best way" and it's just a matter of what you want to return?
> 

These all do different things, and if not given the list form, are suspectible
to shell expansion attacks. You may also be interested in
https://metacpan.org/release/IPC-Run which allows for even better and more
powerful practices.

One important note is that the built-in exec on Microsoft Windows currently does
not handle the list form correctly:

https://rt.perl.org/Public/Bug/Display.html?id=36594

Regards,

        Shlomi Fish


-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Summer Glau Facts - http://shlom.in/sglau-facts

Sometimes you don’t need to be familiar with a better alternative to know that
something sucks. Take Microsoft Word for example.
    — Shlomi Fish’s friend.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to