timothy: Neuer Start - neues Glück - diesmal aber richtig...

Beitrag lesen

Hi

Man kann da mit dem Standard-Modul FindBin abhelfen, welches die Location Deines Scripts alleine findet. Das genaue Konstrukt hab ich grad nicht im Kopf, vielleicht kann das mal jemand anderes posten. Oder im Archiv suchen.

<snippet>--------------------------------------------------

8.84 FindBin

Finds the full path to a script's bin directory, letting you use relative paths to that directory without needing to know the actual location:

use FindBin;
use lib "$FindBin::Bin/../lib";

or:

use FindBin qw($Bin);
use lib "$Bin/../lib";

FindBin exports the following variables:

$Bin

Path to bin directory from which script was invoked.
$Script

Basename of script from which Perl was invoked.
$RealBin

$Bin with all links resolved.
$RealScript

$Script with all links resolved.

If you invoke Perl with the -e option or read the Perl script from STDIN, then FindBin sets both $Bin and $RealBin to the current directory.

</snippet>-------------------------------------------------------------

Bye
Timothy

--
Zwei Dinge im Leben kannst du nicht zurück holen. Den Pfeil, den du verschossen. Und das Wort, das du gesprochen.
(alte indianische Weisheit)