use File::Basename qw(dirname); my $cwd = dirname(__FILE__);