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.

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: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]]
Sent: 11 June 2002 13:39
To: [EMAIL PROTECTED]
Subject: Re: passing an empty string to a perl script via command line


put your cmd-line arguments within quotes

make sure they do not contain quotes themselves

Bryan R Harris wrote:
> Slightly OT, but does anyone know how to pass an empty string to a script
> via the command line?  I have a script that is invoked via:
>
>    rename match-str replace-str <list of files>
>
> .... where the rename script does an s/match-str/replace-str/g on the
> filenames (variables evaluated, of course; the script already works).
>
> Sometimes I'd like to simply delete the match string, but I'm having
> trouble passing an empty string as the replace string.  Unix seems to just
> ignore pairs of single or double quotes.  Any suggestions?
>
> TIA.
>
> - B
>
>
>



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