The OP wants to do it in Perl. I'm afraid it is somewhat counterproductive to suggest shelling out of Perl with backticks or qx//.
| [reply] [Watch: Dir/Any] [d/l] |
Though there's value in learning how to do it in Perl, I respectfully disagree about the "counterproductive" part. The one-liner being done, just wrap backticks around it, use a split /\n/, and that's that (unless there are other constraints). I wouldn't be surprised if it were also faster, though that depends and might not matter.
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] |