latk / p5-Util-Underscore

Util::Underscore – Common helper functions without having to import them
Other
0 stars 1 forks source link

"system" builtin – add sane wrapper #7

Closed latk closed 9 years ago

latk commented 10 years ago

Current Behaviour

The system builtin either gets a single argument – which is passed directly to whatever shell your system is using –, or a list of strings which is exec'd without further ceremony. The former mode is prone to shell injection errors, the latter lacks expressiveness. Also, the return value is the exit code: 0 is success, everything else is usually a failure. However, this runs contrary to Perl's concept of boolean values.

Suggested Behaviour

The module IPC::Run already exists; bindings to this module seem sensible. This would essentially be done via the two functions _::start and _::run, forcing usage of the OOP interface for anything else.