in reply to How to write the perl script for the following linux command?
Are find and cpio unavailable to you? If you have something that works, but simply need to incorporate it into a larger script, you can use the qx{} operator or `backticks`, or system to execute the external calls.
While it's a good practice to invoke external calls as infrequently as practical, it's also a good practice to have a clear goal in refactoring, and to leave things that work as they are unless the clear goal necessitates the refactor.
Writing more code to re-implement the existing solution is just likely to introduce new bugs. On the other hand, if you've decided that the need to re-implement is justified for clearly defined reasons, by all means, File::Find is your first step.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to write the perl script for the following linux command?
by haukex (Archbishop) on Mar 14, 2017 at 18:35 UTC |