in reply to find the path of perl script

I cannot replicate your reported issue with the posted code. Specifically, for your case, running:

#!/usr/bin/perl use strict; use warnings; use Cwd qw(abs_path); my $path = abs_path($0); print "$path\n";

would return

D:/Portal/Types/Program/Script_types.pl

Please test the above code on your machine so we can try to replicate your issue and determine where there is a disconnect. If the above works, please post a minimally complete script that replicates your issue. See How do I post a question effectively?. As well, please wrap code in <code> tags to aid in download - see Writeup Formatting Tips.