On Tue, 07 Dec 2004 11:07:54 -0700, Jeffrey Paul Burger <[EMAIL PROTECTED]> 
wrote:
> I've read a directory into an array called @file_list and need to remove any
> files that start with period from the list (".", "..", ".DS_Store", etc.).
> This is what I've got so far, but it's only removing "..", still leaving "."
> and ".DS_Store". Does the period need to be escaped somehow? Help!
> 
> foreach (@file_list) {
>   if ($_ =~ /^.+/ {

replace with  /^\.+/

have to escape the '.'  otherwise that should match ANY string .  '.' referes to
any character (if i recall correctly)  in a regex. actually, i'm surprised that
it didn't remove /all/ files from the list- maybe I'm wrong somewhere here?


> Thanks sooooooooo much!
> 
> Jeffrey Paul Burger

good luck :)


-- 
Willy
http://www.hackswell.com/corenth

"My APALOGIES, WORLD!
  49% voted for a 
  Senator, 51% voted
  for the cute monkey
  that does tricks!
  DAMN YOU, MONKEY!
    DAMN YOU!"
                    --- from a photo posted to 
                        http://www.sorryeverybody.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to