Roy Olsen wrote:
> I have a Perl script that receives programs and other files from a host
> system for editing. Once the file is transferred the script launches my
> text editor and passes it the name of the file. It works fine for me and
> several colleagues. However, on one user's brand new system (with XP Pro
> and Perl v5.8.6) it won't launch the editor, instead it brings up the
> windows dialog for selecting which program to use.
>
> To make it flexible, I read an environment variable that contains the path
> to the editor. Here's the relevant bits of code:
>
> $EDITOR = $ENV{BASIC_EDITOR};
> ...
> if ($EDITOR) {
> system( "start $EDITOR $file" );
> }
>
> It seems that windows is seeing something like:
>
> start SomeFile
>
> with the editor path being omitted. To track down the cause of this I
> setup some one line test scripts we could run on this user's system. This
> example launches Win.ini in notepad:
>
> system( "start \"c:/program files/ultraedit/uedit32.exe\"
> c:/windows/WIN.ini" );
>
> Again, somehow the program name is disappearing or being ignored. However,
> running this next script in "c:\program files\UltraEdit" opens Win.ini in
> UltraEdit like I'ld expect:
>
> system( "start uedit32.exe c:/windows/WIN.ini" );
>
> Why would it work this way and only on one user's system??
This works fine for me (XP-Pro Perl 5.8.6 B811) :
use strict; use warnings;
my $EDITOR = $ENV{EDITOR} || 'D:/Util/Vim/Vim63/vim.exe';
my $file = shift || 'D:/windows/WIN.ini';
system "start $EDITOR $file";
# or also works without the start
# system "$EDITOR $file";
__END__
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs