With PDK compiled EXEs you can also PDK-specific PerlApp::exe() function 
(http://docs.activestate.com/pdk/9.1/PerlApp.html#perlapp_exe) to easily get 
the path of the PDK application that's currently executing.

So something like:

my $folder=PerlApp::exe();
$folder=~ s/(.*?)[^\\\/]+$/$1/;
print $folder,"\n";

HTH - T

From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Ashley 
Hoff
Sent: Thursday, April 12, 2012 6:38 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Calling a Perl exe with VB - VB/Windows changing current path


Howdy Fellow Win32 Perl users.

At the moment we are in the process of modding a few file munging app's to make 
them Cross platform - this means taking the existing Perl from our Unix based 
servers, making them compatible with Win32, compiling using PDK and then 
modding some existing Windows apps (VB 6) to call the compiled Perl.  (We are 
using the existing VB apps, as apparently Ops can't use command line and don't 
like change :( )

Everything seems to work fine until you navigate to a file via the Windows 
front end, which then changes the current path to where ever the file is 
located, which the Perl app is picking up on.  This is an issue as I want to 
write a report to a subdirectory of where the app is, not where the files are 
found.

I have overcome the issue at the moment using Cwd 'abs_path' and abs_path($0), 
then using a substitute to re-construct the path of where the Reports are to go.

What I would like to know, is there a way that Perl can keep in control of its 
current path?  Or is this something that I should get our VB guru's to look at? 
 (they have asked me to fix it in the Perl.....????  Maybe they are just being 
lazy)

Cheers

Ashley

---------------------------------------------------------------------------
Disclaimer:
Confidentiality:
This message contains privileged and/or confidential information intended only 
for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby notified 
that you must not disseminate, re-transmit, copy or take any action in reliance 
on it. If you have received this message in error please delete the document 
and notify Data Action immediately.
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Data Action.
Viruses:
Any loss/damage incurred by using this material is not the sender's 
responsibility. Data Actions' entire liability will be limited to resupplying 
the material. No warranty is made that this material is free from computer 
virus or any other defect.
---------------------------------------------------------------------------
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to