in reply to Re: strange regexp problem
in thread strange regexp problem

Your code, albeit odd, is correct. The "problem" is that $0 doesn't contain what you expect it to contain. $0 contains the path of program how you called it. If you called it as ./program (which can happen if . is in your PATH, and you called it as program), then $0 will contain ./program, making that the directory name is just a dot.

You might to special case this, and stick in a .., use FindBin, or call your script in a different way.

Abigail

Replies are listed 'Best First'.
Re: Re: strange regexp problem
by Anonymous Monk on Apr 06, 2004 at 15:29 UTC
    thanks!I call that program like what you said.I will try to use FindBin to find absolute directory of the program.