use Cwd; use FindBin qw($RealBin); $this_proc = $0; # Get name of this program $this_proc =~ s#.*\\##; # Just the name.ext $this_proc_path = $0; # Dir. path $this_proc_path =~ s#$this_proc##; $this_proc = $0; # Get name of this program $this_proc =~ s#.*\\##; $this_proc =~ s/\.pl//ig if ($this_proc =~ /\.pl/); $this_proc =~ s/\.exe//ig if ($this_proc =~ /\.exe/); printf("\$this_proc: $this_proc\n"); printf("\$this_proc_path: $this_proc_path\n"); printf("\$RealBin: $RealBin\n");