Meh about:
system 'cat $host.csv'; system 'rm $host.csv';

You have open and print, you have unlink, and you have ways of checking that what you wanted to do worked correctly.

Perl isn't a shell script.

I would suggest that it's more reliable, more efficient, more cross-OS portable, and generally better practice to do these things natively in Perl than shelling out via system.

I get given grief at my $JOB by "scripts" that people who don't know Perl have written in Perl which should be in Perl but are full of awk and sed and grep and wc pipes and other badness. These scripts spawn many more processes than they need to, use more memory, and end up doing knarly things like jamming up, failing silently or causing excessive IO over NFS etc, bringing down our systems.

When we post code on perlmonks, people who don't know as much as we do will take what we've written without understanding it and use it thinking it's the *right* way to do it. I think we should try and be responsible and steer them in the right direction.

/me dismounts soapbox


In reply to Re^2: threads, forks and SSH by serf
in thread threads, forks and SSH by ralph2014

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.