Sunday, September 20, 2009

perl 101: use FindBin

FindBin does one simple thing. It allows you to determine the full path of the Perl script you're running. This allows you to build relative paths to other parts of the filesystem that you might need.

More Perl articles:


Naveed said...

FindBin is pretty awesome. Thanks for sharing. Do you know if there is a python module that emulates FindBin?

rr said...

Hi Naveed.

I would say you want to use os.path:

And the function you want to look at is os.path.abspath() in something like this:


Not sure if that is the best way to do it, but pretty straightforward.