Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open new window from main one 1

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

Ny code is running in main window.
I need to open another one and run some system command in this new window.
How would I do this ?
thanks

Long live king Moshiach !
 
Hi

You mean to open a new browser window on the client's machine ? No way to do it with Perl or other server-side code.

Just open it with JavaScript and request your .exe :
Code:
window[teal].[/teal][COLOR=darkgoldenrod]open[/color][teal]([/teal][green][i]'/cgi-bin/that.exe'[/i][/green][teal])[/teal]

Feherke.
 
Use the start command.
For example
Code:
start "List Perl files" dir *.pl /B
opens new command line window with title "List Perl files" and lists Perl files in bare format executing this command:
Code:
dir *.pl /B

You can use it in perl with system():
Code:
[COLOR=#804040][b]use strict[/b][/color];
[COLOR=#804040][b]use warnings[/b][/color];

[COLOR=#804040][b]my[/b][/color] [COLOR=#008080]$rc[/color]=[COLOR=#804040][b]system[/b][/color]([COLOR=#ff00ff]'[/color][COLOR=#ff00ff]start "List Perl files" dir *.pl /B[/color][COLOR=#ff00ff]'[/color]);
[COLOR=#804040][b]print[/b][/color] [COLOR=#ff00ff]"[/color][COLOR=#6a5acd]\$[/color][COLOR=#ff00ff]rc = [/color][COLOR=#008080]$rc[/color][COLOR=#6a5acd]\n[/color][COLOR=#ff00ff]"[/color]
 
When you run the above example in command line window with
Code:
perl [i]perl_script.pl[/i]
you will see that it opens second command line window where it executes the system command DIR...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top