> -----Original Message----- > From: Anders Holm [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 8:46 AM > To: Ramprasad A Padmanabhan; [EMAIL PROTECTED] > Subject: RE: passing an empty string to a perl script via command line > > > And, for completeness: > > I'd think that it's not *nix that ignores the "", but rather > Perl says that > the variable that you assign the value to would then be > undefined and just > refuses to work with it. > > - use strict; should give you a warning about that.
FWIW, "use strict" is a compile-time pragma and has nothing to do with the contents of any variable. It does not issue warnings; it raises compile-time errors. Given the command: $ perl myprog.pl foo '' bar $ARGV[0] will be 'foo' $ARGV[1] will be '' (zero-length string, NOT undef) $ARGV[2] will be 'bar' If you're using Windoze, you need to use double-quotes: C:\> perl myprog.pl foo "" bar The parsing of the command line and preparation of the argument list is a function of the shell or command interpreter. Perl just takes the argument list given to it via the execve() call. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]