P
Prabh
Hello all,
I need to pass a couple of args to my perl script which are strings of
text.
Arg1: 'one two'
Arg2: 'three four'
Script:
====================================================
#!/usr/local/bin/perl
use strict ;
use warnings ;
my $first_arg = $ARGV[0] ;
my $sec_arg = $ARGV[1] ;
print "First: $first_arg\nSecond: $sec_arg\n" ;
====================================================
On Unix, when I pass the args as,
<%> perl testArgs.pl 'one two' 'three four'
I get the output,
First: one two
Second: three four
When I try the same script and pass the args in the same way on
Windows, I get,
First: 'one
Second: two'
Its only when I replace the single-quote on the command-line with
double-quotes do I get the same results as Unix.
<%> perl testArgs.pl "one two" "three four"
Is there any platform independent way of passing args which result in
the same
ARGV[0] and ARGV[1] on all platforms?
Perl version: perl v5.6.0
Thanks for your time,
Prabh
I need to pass a couple of args to my perl script which are strings of
text.
Arg1: 'one two'
Arg2: 'three four'
Script:
====================================================
#!/usr/local/bin/perl
use strict ;
use warnings ;
my $first_arg = $ARGV[0] ;
my $sec_arg = $ARGV[1] ;
print "First: $first_arg\nSecond: $sec_arg\n" ;
====================================================
On Unix, when I pass the args as,
<%> perl testArgs.pl 'one two' 'three four'
I get the output,
First: one two
Second: three four
When I try the same script and pass the args in the same way on
Windows, I get,
First: 'one
Second: two'
Its only when I replace the single-quote on the command-line with
double-quotes do I get the same results as Unix.
<%> perl testArgs.pl "one two" "three four"
Is there any platform independent way of passing args which result in
the same
ARGV[0] and ARGV[1] on all platforms?
Perl version: perl v5.6.0
Thanks for your time,
Prabh