I noticed that your solution uses the construct "system( 1, 'start command' )". A month or so ago, I saw this construct used in a posting to this list and added it to a Perl/Tk script to launch a web page in the default browser. Control is immediately returned to the calling perl/Tk script and the browser opens independent of the calling script. In took a bit of fiddling but it works great (notice the quotes around the url part after the "http://").
my $url = '' . $sn . '&task=viewrecord"';
system(1, "start $url");
At the time, I had never seen this construct before and tried to find were it was documented. It's not documented in "perlfunc" under either the system or the exec call (that I can recognize -- which might not be saying much). And I looked at the ActivePerl documentation related to Windows programming and couldn't find an explanation of what "system( 1, "start command") does -- as opposed to plain old "system( "start command")".
Is this undocumented functionality of the system call available on Win32 or is there documentation somewhere that explains what it does?
Regards,
... Dewey
"$Bill Luebkert"
<[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 06/07/2006 07:55 PM |
|
Edward Bosco wrote:
> All -
>
> I have a series of windows command line utilities that act as servers.
> I'm trying to invoke these from a Perl front end.
>
> I've been trying various combinations, and I can get an independent
> cmd.exe running as viewable by Task Manager.
>
> I just can't see it as an application, so a normal user can see the
> output.
>
> Here's an example.
>
> $d='start c:\windows\system32\cmd.exe ';
> @out=qx($d,1);
>
> ==
>
> I don't care about killing a process from Perl; the user can do that if
> they wish. The user can also see any output from the program while it's
> running.
>
> Exec and system don't do it for me, as the utilities are meant to carry
> on running indefinitely, and I want to do other things with the Perl
> front end.
>
> Any thoughts of how to approach this?
use strict;
use warnings;
# example server (sleeps for 30 seconds)
my $d = 'start C:\windows\system32\cmd.exe /c F:\perl\bin\perl sleep.pl 30';
my $pid = system 1, $d;
print "PID: $pid\n";
__END__
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs