FindBin - Locate directory of original perl script
use FindBin; BEGIN { unshift(@INC,"$FindBin::Bin/../lib") } or use FindBin qw($Bin); BEGIN { unshift(@INC,"$Bin/../lib") }
Locates the full path to the script bin directory to allow the use of paths relative to the bin directory.
This allows a user to setup a directory tree for some software with directories <root>/bin and <root>/lib and then the above example will allow the use of modules in the lib directory without knowing where the software tree is installed
$Bin - path to bin directory from where script was invoked $Script - name os script from which perl was invoked $RealBin - $Bin with all links resolved $RealScript - $Script with all links resolved
Graham Barr <bodg@tiuk.ti.com> Nick Ing-Simmons <nik@tiuk.ti.com>
Copyright (c) 1995 Graham Barr & Nick Ing-Simmons. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
# $Log: FindBin.pm,v $ # Revision 1.1 1995/11/14 11:00:09 gbarr # Initial revision #
To install FindBin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FindBin
CPAN shell
perl -MCPAN -e shell install FindBin
For more information on module installation, please visit the detailed CPAN module installation guide.