Thank you very much, Rob.
 
Lizhe Xu
US DHS PIADC
PO Box 848
Greenport NY 11944
 
[EMAIL PROTECTED]
Tel: 631 323 3023
fax: 631 323 3295

________________________________

From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Thu 6/14/2007 10:36 AM
To: beginners@perl.org
Cc: Xu, Lizhe
Subject: Re: Hash Key is a Null Value



Xu, Lizhe wrote:
> On Jun 14, 8:50 am, [EMAIL PROTECTED] (Chas Owens) wrote:
>> To force Data::Dumper to do the right thing for the
>> display you must set $Data::Dumper::Useqq to 1.  It will then use
>> doublequoted strings and escape characters (like \t, \n, \0 etc).
>>
>> perl -MData::Dumper -e '$Data::Dumper::Useqq = 1;%h = ("\0", 3);print
>> Dumper(\%h);'
>> $VAR1 = {
>>           "\0" => 3
>>         };
>
> The above code did not work on my XP computer, I got:
>
> C:\>perl -MData::Dumper -e '$Data::Dumper::Useqq = 1;%h = ("\0", 3);print 
> Dumper (\%h);'
> Can't find string terminator "'" anywhere before EOF at -e line 1.
> 
> When I changed single quote to double quote, the result is different
> C:\>perl -MData::Dumper -e "$Data::Dumper::Useqq = 1;%h = ("\0", 3);print 
> Dumper
> (\%h);"
> $VAR1 = {
>           "SCALAR(0x36c10)" => 3
>         };
> 
> 
> How to fix it? Thanks.

Windows accepts only double quotes as parameter delimiters. This should work
on your system:

perl -MData::Dumper -e "$Data::Dumper::Useqq = 1;%h = (qq(\0), 3);print Dumper 
(\%h);"

HTH,

Rob



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to