in reply to Re: Create new command winow using Term::ShellUI
in thread Create new command winow using Term::ShellUI

To include our friends with US installations of Microsoft Windows, always quote $^X:

my $cmd = join ' ', q(cmd.exe /c start ), qq{"$^X"},__FILE__, '1forarg +v';

Otherwise, the string interpolation will run afoul of Program Files :-)

Replies are listed 'Best First'.
Re^3: Create new command winow using Term::ShellUI
by kranthi (Sexton) on Jun 04, 2008 at 12:46 UTC
    Hi, Thanks for the information. I was able to create a new Command window. can you please explain me about the use of '1forarg'. Since if i try to pass any arguments from the commnad it doesnt takes but gives me '1forarg' as an argument. Thanks in advance.
      ???
      die "usage: perl argv.test.pl a b c d ...\n" unless @ARGV; for(0..$#ARGV){ print " ARG $_ $ARGV[0]\n"; } __END__ C:\>perl argv.test.pl usage: perl test.pl a b c d ... at argv.test.pl line 2. C:\>perl argv.test.pl 1 2 a b c ARG 0 1 ARG 1 1 ARG 2 1 ARG 3 1 ARG 4 1 C:\>
        you want $ARGV[$_] but thats probably a joke
        die "usage: perl argv.test.pl a b c d ...\n" unless @ARGV; for(0..$#ARGV){ print " ARG $_ $ARGV[$_]\n"; } __END__ C:\>perl argv.test.pl usage: perl test.pl a b c d ... at argv.test.pl line 2. C:\>perl argv.test.pl 1 2 a b c ARG 0 1 ARG 1 2 ARG 2 a ARG 3 b ARG 4 c C:\>