in reply to program path

And if you need the path, you can go with
my ($path, $script) = $0 =~ /^(.*\/)?(.+)/;