Many thanks! Both of your snips provided the necessary clues.

Best,

Jeffrey Paul Burger
2675 W. Hwy. 89A - PMB 455
Sedona, AZ 86336
928-203-0170

"There are only two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is."
                                    --Albert Einstein



> From: "John W. Krahn" <[EMAIL PROTECTED]>
> Date: Tue, 07 Dec 2004 11:55:48 -0800
> To: Perl Beginners <[EMAIL PROTECTED]>
> Subject: Re: Another regular expression matching quandry
> 
> Jeffrey Paul Burger 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 ($_ =~ /^.+/ {
> 
> perldoc perlre
> [snip]
>             .   Match any character (except newline)
> [snip]
>         Any single character matches itself, unless it is a metacharacter with
>         a special meaning described here or above.  You can cause characters
>         that normally function as metacharacters to be interpreted literally
> by
>         prefixing them with a "\" (e.g., "\." matches a ".", not any
> character;
>         "\\" matches a "\").  A series of characters matches that series of
>         characters in the target string, so the pattern "blurfl" would match
>         "blurfl" in the target string.
> 
> 
>>     $discard = shift (@file_list);
> 
> perldoc perlsyn
> [snip]
>         If any part of LIST is an array, "foreach" will get very confused if
>         you add or remove elements within the loop body, for example with
>         "splice".   So don't do that.
>                     ++++++++++++++++
>                     ================
> 
>>   }
>> }
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 



-- 
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