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.