Peter Eisengrein <[EMAIL PROTECTED]> wrote:
> sorry about that. a bit too quick on the trigger finger. I have the
following:

No problem.  A little fat-fingering happens now and then.

> @files = grep { /^ccs_[cas|pri|atsm]/ && -f "$dir/$_" } readdir(DIR);
>
> There are other files in $dir that start with ccs but I only want
> ccs_cas ccs_pri or ccs_atsm but for some reason it seems to also
> match a filename that starts with ccs_trsum. What am I doing wrong?

You don't want those square brackets.  They're giving you a character
class of [acimprst|] so ccs_t.* will match.  Try:

@files = grep { /^ccs_(cas|pri|atsm)/ && -f "$dir/$_" } readdir(DIR);

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

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to