• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Menus

Hi guys hope you can help.

I have a menu (menu.pl) that you guys helped with.

What I want to do is when I select an option, to run that selection in a new command window, separate from the menu.pl, so that I can make further selections, while the first one that I selected (now running in a new window) continues to run. If I need to abort the external script that is now running, to not kill the menu.pl script.

Any help greatly appreciated.

Here is the code so far..

print <<EOF;
Press 1 for this subroutine
Press 2 for this subroutine
Press 3 for this subroutine
Press 4 for this subroutine
Press 5 for this subroutine
Press 6 for this subroutine

EOF

print "Enter menu choice: ";
my $choice = <STDIN>;
chomp $choice;

if ($choice == 1) {
   sub1();
}
elsif ($choice == 2) {
   sub2();
}
else {
   die "$choice is an invalid menu option\n";
}


sub sub1 {
  print "sub1\n";
}

sub sub2 {
  print `hithere.pl`;
}


Thanks guys.
0
Simon336697
Asked:
Simon336697
  • 2
  • 2
2 Solutions
 
ozoCommented:
sub sub2 {
  system"hithere.pl &";
}


0
 
ahoffmannCommented:
> .. to run that selection in a new command window
what do you mean by "command window", xterm?
0
 
Simon336697Author Commented:
Sorry ahoff,
Im using ActiveState Perl on windows xp.
0
 
ahoffmannCommented:
sub sub2 {
  system("cmd.exe /K --full-path--to--/hithere.pl");
}
0
 
Simon336697Author Commented:
Thanks ozo/ahoff!

S
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now