in reply to Perl in one line

Others have provided possible solutions to your question.

If you are familiar with unix and are just ramping up with Perl, you may find this to be helpful: UNIX 'command' equivalents in Perl.