Doug, while your posts are always full of useful info, you made
a typo or two in this one.  You wrote:

> my @filelist = grep { !/^.+/ } readdir DIR;

I know you didn't mean to use that regex.  Even if you fix it
by putting a backslash before the period, it still has defects.
In the unix world, where '...' is a legal filename [instead of
a reference to the 'grandparent' directory] and files like
.login and .profile are omnipresent, you would lose a lot of files
to copy.  When I only want to avoid the . and .. files, I use

grep { !/^\.\.?$/ }

although I have been told by the comp.lang.perl.misc experts
that it is theoretically possible to have a unix file named
'..\n' [two periods and a newline] which this would lose.  But

grep { !/^\.\.?\z/ }

would handle such a bizarre eventuality.

In win32 you can make matters even more complicated.  You
can create a file named '.dir', for example.  But that shows
up as the long-name version.  So you'd have to make sure whether
you were parsing the long-names or short-names to determine
whether you matched that file...

David
--
David Cassell, OAO                     [EMAIL PROTECTED]
Senior computing specialist
mathematical statistician



---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to