On 7 Jun 2004 at 16:31, Chris Costello wrote:
> On Sun, 2003-10-05 at 10:32, Dan Langille wrote:
>
> > I think it might just be easier to do a straight comparison of the first N
> > characters of the two strings where N = length of the directory name.
> >
> > Any suggestions?
>
>You can do:
On Sun, Oct 05, 2003 at 11:32:11AM -0400, Dan Langille wrote:
> Hi,
>
> I have a perl regex to test if a file resides under a particular
> directory. The test looks like this:
>
> if ($filename =~ $directory) {
># yes, this filename resides under directory
> }
>
> This is working for most c
On Sun, 5 Oct 2003, Dan Langille wrote:
> Hi,
>
> I have a perl regex to test if a file resides under a particular
> directory. The test looks like this:
>
> if ($filename =~ $directory) {
># yes, this filename resides under directory
> }
>
> This is working for most cases. However, it fails
> I think it might just be easier to do a straight comparison of the first N
> characters of the two strings where N = length of the directory name.
>
> Any suggestions?
You might try index() or substr().
Fred
--
"MOTHER:
Half a word."
pgp0.pgp
Description: PGP signature
Hi,
I have a perl regex to test if a file resides under a particular
directory. The test looks like this:
if ($filename =~ $directory) {
# yes, this filename resides under directory
}
This is working for most cases. However, it fails is the directory
contains a +. For example:
$filename =
5 matches
Mail list logo