On 6/1/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 6/1/07, Ben Edwards <[EMAIL PROTECTED]> wrote:
snip
> The variable $flist has something like '*.cvs' in it which I guess is
> almost but not quite a regular expresion.
snip

* in shell matching terms means .* in regex terms
. in shell matching terms means \. in regex terms
cvs is the same

Where does the value in $flist come from?  If you are originating it then say
my $flist = qr(^.*\.cvs$);

instead of

my $flist = "*.cvs";

If the user is supplying the value, well I think there is a module
that will turn a shell match into a regex.  You might look at
Regex::Common.

The name of the module is Regexp::Common, and it, unfortunately,
doesn't have a translator.  You might be able to get by with the code
in the Perl Cookbook*.

* http://www.unix.org.ua/orelly/perl/cookbook/ch06_10.htm

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


Reply via email to