I'd rather you check for Win32 first and just not set a __DIE__ handle if one isn't needed. Otherwise, quite handy.
-
tye
(but my friends call me "Tye")
| [reply] |
| [reply] [d/l] |
The PROMPT variable is also not set from the Start - Run command.
Another usage for this would be to determine whether to print to a console, or to do a Win32::MsgBox instead. (I tried to figure out how the script could figure where it was called from some time ago and couldn't work it out...) Thanks!
Cheerio!
Osfameron | [reply] |
As far Windows 98SE is concerned, the PROMPT is set $p$g whether a script is invoked from the command line, clicked, or from the Start-Run dialog box.
The CMDLINE is set to whatever was typed on the command line
and to WIN if invoked by clicking or from the Start-Run box.
If you use the Start-Run box you can pass arguments just as you can from the command line.
| [reply] |
I don't know about Win2k or NT. But on 95/98/ME the /k flag of command.com might be useful.
Changing the Open "Action" of .pl files (In folder options->file types) to "command.com /k c:\perl\bin\perl.exe" should do. | [reply] |
| [reply] |
I personally recommend creating a batch file that has something like
perl.exe -w %1
pause
Whala.... as long as perl is set in your enviroment variables, all you have to do is run through the batch file instead of adding in code to each project. If you use Ultraedit, you can even plug this into a macro and it saves you lots of time-and headaches
Derek
| [reply] |
Doesn't DOS shells (I use that term loosely) offer an errorlevel check?
So, you could pause only if the process returns a non-zero exist status:
perl.exe -w %1
if errorlevel 1 pause
| [reply] |