in reply to Having a script find itself on the file system in Windows XP and other OSs
For more complex cases, you can use FindBin module.
FindBin exports the following variables:
$Bin - path to bin directory from where script was invoked $Script - basename of script from which perl was invoked $RealBin - $Bin with all links resolved $RealScript - $Script with all links resolvedI've seen FindBin used in programs which try to work out of the box regardless of the OS they've been run on. MRTG - multi router traffic grapher is one example.
|
|---|