Hi Bob.

Well, all I can now say is "DOH!". Oooppsie, my mistake.. ;) Too green on
this yet.. Thanks for clearing up my confusions!

Cheers!

Best Regards

Anders Holm
Critical Path Technical Support Engineer
----------------------------------------------------------------------
Tel USA/Canada: 1 800 353 8437
Tel Worldwide:  +1 801 736 0806
E-mail:         [EMAIL PROTECTED]
Internet:       http://support.cp.net


-----Original Message-----
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: 11 June 2002 15:03
To: [EMAIL PROTECTED]
Subject: RE: passing an empty string to a perl script via command line


> -----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]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to