Derek B. Smith wrote:
> 
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> 
>>Derek B. Smith wrote:
>>
>>>I am trying to run logic that will copy/delete  3
>>>versions of log.\d+ files to their respective
>>>directories.  Because there are so many
>>directories, I
>>>have built a hash table instead of using a bunch
>>of
>>>"if else conditions" with reg exps. My problem is
>>it
>>>is not returning the words_num translation from
>>the
>>>print sub routine call words_to_num.  
>>>
>>>BEGIN CODE
>>>
>>>
>>>foreach my $log (@twoweekdir_contents) {
>>>  $NBlogs2[$i++] = 
>>>  $log if ($log =~
>>>   /bpcd\/log|bpdbm\/log|bptm\/log.\d+/);
>>Your pattern says match the string 'bpcd/log' OR
>>'bpdbm/log' OR 'bptm/log'
>>followed by any character followed by one or more
>>digits and the pattern can
>>be located anywhere in the $log variable.  Are you
>>sure that you don't want
>>digits after 'bpcd/log' or 'bpdbm/log'?
> 
> No I do not want to do this....nice catch. It should
> read /bpcd\/log|bpdbm\/log|bptm\/log\.\d+/);
> so that I catch log and a period and number after the
> period.

If you want all the logs to end with '\.\d+' then you need something like:

m!bp(?:cd|dbm|tm)/log\.\d+!



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>


Reply via email to