Skip to content

Instantly share code, notes, and snippets.

@moznion
Created October 22, 2012 01:17
Show Gist options
  • Save moznion/3929167 to your computer and use it in GitHub Desktop.
Save moznion/3929167 to your computer and use it in GitHub Desktop.
OLD VERSION!!! Current version is gist: 3911761.
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