> ...But I would strongly
> recommend to use File::Find instead!
This reminds me of a question I have about File::Find,
though this is not really advocacy-related.
(I can't find a Perl forum for general / expert
questions.)
In a script that does a lot of file manipulation
(renames, deletes, symbolic linking, and finding)
I ended up having to run the corresponding Unix
command via the 'system' perl function, instead of
using the corresponding native Perl function,
because I needed certain options, like -f (force),
-r (recursive), that are apparently not supported
by the Perl function. No Perl document/man page
that I can find mentions these.
In particular, because I needed to prune the dir tree,
instead of using File::Find function, I had to do this:
$findcmd = "/usr/bin/find $ROOT_DIR ";
if ( -d $UNWANTED_DIR )
{
$findcmd .= "-path \"$UNWANTED_DIR\" -prune -o ";
}
# Header files ONLY, for ALL PASSES
$findcmd .= "-name \"*.[Hh]\" -print";
@files = `$findcmd`;
This worked fine, but as a Perl ADVOCATE (heh,
I DID find an advocacy angle!), I would prefer
to use Perl functions.
Can someone tell me if it is true, then
WHY are Unix command options NOT supported by the
corresponding Perl function, in many cases?
Is this because these command line options are
not standardized, and Perl would have to choose
between following say, a BSD vs a System V flavor?
Just follow POSIX, I'd say.
Thank you,
Wayne Haufler / Migratec Inc.
-----Original Message-----
From: Jan Dubois [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 4:05 PM
To: Elaine -HFB- Ashton
Cc: [EMAIL PROTECTED]
Subject: Re: need a diplomatic win32 perl person :)
On Mon, 15 Oct 2001 15:22:58 -0500, Elaine -HFB- Ashton
<[EMAIL PROTECTED]> wrote:
>We got a bit of mail this morning from a guy asking where
>the File-Tools distribution by ASHER had gone off to on CPAN.
[...]
>I don't use a PC so perhaps someone well aquainted with Win32 Perl and the
>modules useful on Win32 could drop the magazine a line and try to correct
>the error in a nice way as well as maybe get a chance to write more
>interesting articles.
There is nothing Win32 specific in File::Tools. It is basically the
"original" versions of File::Copy and File::Recurse. I can send you a copy
if you want to (it's 1996 vintage). This code was put into the public
domain. I have no idea if it ever was on CPAN or not. It is available
from the ActiveState package repository by
ppm install File::Tools
Of course you will still not be able to use the vintage File::Copy module
as it will be hidden in site/lib/File/Copy.pm, in the shadow of
lib/File/Copy.pm. :) File::Recurse might work. But I would strongly
recommend to use File::Find instead!
Feel free to forward to journalist and/or the guy looking for File::Tools.
-Jan