use Cwd 'abs_path'; my $scriptpath = abs_path($0);