in reply to system commands/shell and perl variables.
With a command as complex as you showed, I would very much recommend doing as much of it in Perl as possible instead of shelling out - there are potential security issues, quoting challenges, etc. with shelling out. I wrote about that at length here (with code examples). In particular, both fgrep and awk can be replaced by pure Perl. Instead of ps, you might try Proc::ProcessTable. That leaves only xl and sockstat. If you want to run those external processes and need to feed something to their STDIN, I'd recommend IPC::Run3. Otherwise, if you just want a simple replacement for backticks, there's capturex from IPC::System::Simple.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: system commands/shell and perl variables.
by knight.neo (Initiate) on Jan 22, 2019 at 17:34 UTC | |
by haukex (Archbishop) on Jan 22, 2019 at 18:00 UTC | |
by knight.neo (Initiate) on Jan 22, 2019 at 19:07 UTC | |
by haukex (Archbishop) on Jan 23, 2019 at 20:15 UTC |