List Info

Thread: Re: STDIN not available/@ARGV empty




Re: STDIN not available/@ARGV empty
country flaguser name
United States
2007-03-09 18:55:33
Jan Dubois wrote:
>  For example:
> 
>       ASSOC .pl=PerlScript
>       FTYPE PerlScript=perl.exe %1 %*
> 
>   would allow you to invoke a Perl script as follows:
> 
>       script.pl 1 2 3
> 
>   If you want to eliminate the need to type the
extensions, then do the
>   following:
> 
>       set PATHEXT=.pl;%PATHEXT%
> 
>   and the script could be invoked as follows:
> 
>       script 1 2 3

For some reason, that's never really worked for me :

 > assoc .pl
.pl=Perl

 > ftype Perl
Perl="F:perlbinperl.exe" "%1" %*

 > set PATHEXT=.pl;%PATHEXT%

 > echo %PATHEXT%
.pl;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

 > printargs 1 2 3 4
ARGS:

 > printargs.pl 1 2 3 4
ARGS:

 > perl printargs.pl 1 2 3 4
ARGS:
'1'
'2'
'3'
'4'

XP Pro SP2: B811

printargs.pl :

#!perl --

use strict;
use warnings;

print "ARGS:n";
print "'$_'n" foreach ARGV;

__END__
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Userslistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )