Created
October 22, 2012 01:17
-
-
Save moznion/3929167 to your computer and use it in GitHub Desktop.
OLD VERSION!!! Current version is gist: 3911761.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Cwd; | |
use File::Basename; | |
sub get_full_path { | |
my ($filename, $dir_path) = File::Basename::fileparse $0; | |
my $current_path = Cwd::getcwd(); | |
$dir_path =~ s!^$current_path!!; | |
$dir_path =~ s!^\.?/!!; | |
return $current_path . '/' . $dir_path . $filename; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment