You're talking about silliness ... and I'm getting more confused.

Heaven forbid that the tarball (or somepath) has a space or pipe or < or > or some other funny character ($ on unix, %..% on windows, etc.) which the shell will play havoc with. Easy enough to fix, right? What if the windows version takes different parameters than the unix version? (Some tar's on Linux have not liked the dash for the tar commands, for example.) Having had to write my perl for Windows (ia32, ia64, x86-64), AIX, Sun, HP (PA/RISC, ia64), and Linux (ia32, ia64, x86-64, ppc64, s390, s390x), (not with Archive::Tar, but with other modules) I am ever so thankful that these modules exist, provide a single cross-platform interface, and provide a simple interface that allows me to concentrate on getting my work done rather than dealing with the short-lived filehandles, or with commandlines to other software that keeps changing from platform to platform. The only system software I deal with now is stuff that is platform-specific anyway (e.g., Windows Installer). And even that, I'm looking to use OLE or something.

I suppose the point is - your first example doesn't work for a tarball named "My Data.tar" which is supposed to go into "C:\My Documents\My Excel Spreadsheets". The point is not that this is something easy to fix - the point is that it is something easy to get wrong. And that's what modules are there for - helping us get it right by handling all the "silly" cases.

(Oh, and, just as another point on how easy it is to get wrong: you missed the "-C" for $some_path. I used "archive_tar.pl" on purpose to avoid the annoying tar commandline syntax ;-})


In reply to Re^14: Should Modules Do I/O? by Tanktalus
in thread Should Modules Do I/O? by pboin

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.