I would recommend debugging your script by first printing the ssh statement instead of putting it in backticks. This way you can verify what will be sent and once you are satisfied with that, you can put it in backticks. You will note that you are sending a bad command to the other server. You will also then figure out why you are getting a "could not resolve hostname" error.
There are a couple of issues with your files_DEL subroutine. my @LIB_FILES = shift
is not going to do what you want. Remove that line and use @_ instead of @LIB_FILES. Running system
inside your subroutine will run that command on your local computer. What you really intend to do is return a string like " && rm -fr lib1 && rm -fr lib2" to the caller which in turn will append it to the ssh command.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||