Just want to ask if there's a function or any other way I
can get the path of installed perl.exe to avoid typing the
hardcoded path in my perl source code?
Here is my current code(I've edited sample code in Perl Cookbook):
Win32::Process::Create($Win32::Process::Create::ProcessObj, 'C:/Perl/bin/perl.exe', #<--THIS LINE IS MY CONCERN 'perl xdos.pl', 0, # Don't inherit. DETACHED_PROCESS, # ".") or # current dir.
I'm trying to remove DOS Window from Perl Tk program which
I succesfully did but I couldn't find a built in funtion to
get the path of perl.exe to supply the 3rd parameter of
Win32::Process::Create().
My perl application will be used in different PC and Perl
was installed in different paths and drives in some PCs. So
I need to not use the hardcoded path.
I am planning to use the "ftype perl" in command line using
system() to get the perl.exe path but I think it is better
to use perl's way since "ftype" is not available in other
OS.
I'd tried to search functions and Environment variables but
I couldn't find what I want.
I hope there is a way other than "ftype perl".
Please lend me the wisdom for this problem.
-toastbread
In reply to Avoiding Hardcoded path of Perl.exe in coding by toastbread
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |