[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: htags regex error

From: Rui Lopes
Subject: Re: htags regex error
Date: Mon, 20 Oct 2003 23:00:39 +0100

Hi Shigio,

On Seg, 2003-10-20 at 15:06, Shigio Yamaguchi wrote: 
> > but a better solution isn't:
> > $s =~ s/^(\Q$name\E)/<A HREF=$srcdir\/$html#$lno>$1<\/A>/;
> > 
> > or even:
> > $name = quotemeta($name);
> > 
> > instead of:
> > $name =~ s/([^\w])/\\\1/g; ?
> > 
> > 
> > I known that quotemeta or \Q do the same thing, but why not using it
> > instead of an explicit regex?
> Htags is written only by the function of perl4.
> The \Q and \E are new function in perl5.

Ah!  that explains it then :)

I didn't known that the minimum version needed was perl4.  I didn't
found any minimum requirements document for global, is there any?

> Of course, we can move to perl5 or perl6 but I should rather move to
> C language for the performance and the extendibility in the future, I think.

At the moment global is fast enough for me, but an extra speed boost is
always welcome :)

> > We shouldn't also escape html chars in $name?
> Are there any troubles? What should we do?

Humm, maybe some "strange" user uses &<; chars in their filenames.  A
html escape function would prevent this (htags already uses that when
showing the cross-ref source files in html).

Rui Lopes

reply via email to

[Prev in Thread] Current Thread [Next in Thread]