noviceuser has asked for the wisdom of the Perl Monks concerning the following question:

I need to delete multiple clients using command: p4 client -d <client-name>, so i want to write a perl script where i can read a file containing list of all the client names, and delete the same using the script.

  • Comment on perl script to execute a single command for multiple entries

Replies are listed 'Best First'.
Re: perl script to execute a single command for multiple entries
by GrandFather (Saint) on Nov 24, 2020 at 06:01 UTC
    so i want to write a perl script

    Sure, go for it, I give you permission. Was there anything else you wanted?

    To put it another way: where are you having a problem? What have you tried already and how did it fail? The more effort you put into your question the better the help you will get. As a general thing we don't do your work for you, but we often go to extraordinary lengths to help you understand how to do things for yourself - give us that chance.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: perl script to execute a single command for multiple entries
by haukex (Bishop) on Nov 24, 2020 at 18:41 UTC
Re: perl script to execute a single command for multiple entries
by stevieb (Canon) on Nov 24, 2020 at 22:32 UTC

    See the open documentation on opening and reading a file, and the unlink documentation on deleting files.

Re: perl script to execute a single command for multiple entries
by perlfan (Vicar) on Nov 30, 2020 at 19:14 UTC
    Seems more like a shell script. If you want to use Perl, then you can do it using any number ways for Perl to generate child processes. Based on your description I recommend system or if you have multiple CPUs (or vCPUs), use fork via something like Parallel::ForkManager. I am assuming non-Windows, is that okay? :D