in reply to Re^13: Should Modules Do I/O?
in thread Should Modules Do I/O?

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 ;-})