Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Cwd 'abs_path';
- print abs_path($0);
- use File::Basename;
- my $dirname = dirname(__FILE__);
- #!/usr/bin/perl
- use FindBin;
- $0 = "stealth";
- print "The actual path to this is: $FindBin::Bin/$FindBin::Scriptn";
- use Cwd qw(abs_path);
- my $path = abs_path($0);
- print "$pathn";
- $ENV{'SCRIPT_NAME'}
- use FindBin '$Bin';
- print "The script is located in $Bin.n";
- use strict ; use warnings ; use Cwd 'abs_path';
- sub ResolveMyProductBaseDir {
- # Start - Resolve the ProductBaseDir
- #resolve the run dir where this scripts is placed
- my $ScriptAbsolutPath = abs_path($0) ;
- #debug print "$ScriptAbsolutPath is $ScriptAbsolutPath n" ;
- $ScriptAbsolutPath =~ m/^(.*)(\|/)(.*).([a-z]*)/;
- $RunDir = $1 ;
- #debug print "$1 is $1 n" ;
- #change the 's to /'s if we are on Windows
- $RunDir =~s/\///gi ;
- my @DirParts = split ('/' , $RunDir) ;
- for (my $count=0; $count < 4; $count++) { pop @DirParts ; }
- my $ProductBaseDir = join ( '/' , @DirParts ) ;
- # Stop - Resolve the ProductBaseDir
- #debug print "ResolveMyProductBaseDir $ProductBaseDir is $ProductBaseDir n" ;
- return $ProductBaseDir ;
- } #eof sub
Add Comment
Please, Sign In to add comment