$ perl ./my/script.pl $(which myprogram) #### my $full_program = `which $program`; chomp $full_program;