There's also FindBin but I don't recommend its use, I've had troubles with it in the past (permissions issues in CGI scripts on Linux) plus, like tye said, FindBin is broken.
Comment on Re^2: How could you make a script think it's running in its own directory?