File::Copy

[prev] [thread] [next] [lurker] [Date index for 2005/09/21]

From: Abigail
Subject: File::Copy
Date: 00:51 on 21 Sep 2005
--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


Another of those Perl modules that should never have been made.

A favourite of the perlmonks crowd (perlmonks is to Perl what slashdot
is to computer geeks in general -- the shine attracts the teenagers,=20
but it ain't very useful); it has worked itself into the main Perl
distribution, and someone has had a lot of success in passing the kool-aid.
Nowadays, if you dare to write:

    system cp =3D> $src, $dest;

on most Perl forums, Perl nitwits pop up their heads from under their rocks
and flame you for not being 'pure perl', and for writing code that doesn't
run on their Billware. No, they say, you ought to use File::Copy.

Now, this rant isn't about File::Copy's rather limited capabilities
compared to 'cp'. Using a directory as a destination is beyond its
capabilities, and

    File::Copy::copy ($file1, $file2, $dir)

will complain, but destroy your $file2 anyway. Not to mention it doesn't
have support for equivalences of 'cp -r', 'cp -p' or any of the other
options you'll have with 'system'.=20

Nor is this rant about the fact File::Copy also provides a 'syscopy'
routine, but doesn't actually export 'syscopy'.

No, I hate File::Copy because when copying a executable, it loses the=20
execution bit. Having been bitten by that 'feature' in the past,
I haven't used File::Copy for a long, long time. But I'm not the only
person using Perl at the company I work for. Had a long debugging
session today -- which ended with replacing File::Copy with 'system "cp"'.



Abigail

--wRRV7LY7NUeQGEoC
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFDMKCMBOh7Ggo6rasRAvwYAJ9SGtY7mMdGSliZN7aN2ztZgwoUdQCeIeSD
nmqNlNg+wjFgXMGCshb3WaU=
=kj08
-----END PGP SIGNATURE-----

--wRRV7LY7NUeQGEoC--

Generated at 14:00 on 22 Sep 2005 by mariachi 0.52