Re: What is the better method for using hash??



"sonet" <sonet.all@xxxxxxxxxxxxx> wrote:
> How to compare the memory usage??

I'd do it by measuring their memory usages (on a large enough sample), and
then comparing them. I find this to be convenient if not very portable:
print +(`ps -p $$ -o rss `)[1];


> What is the better??
>
> (A)
> hash1{TYPE1}{VALUE1}='A';
> hash1{TYPE1}{VALUE2}='B';
> hash1{TYPE1}{VALUE3}='C';
> hash1{TYPE2}{VALUE1}='1';
>
> or
> (B)
> TYPE1{VALUE1}='A';
> TYPE1{VALUE2}='B';
> TYPE1{VALUE2}='C';
> TYPE2{VALUE1}='1';

Neither is better. A is a syntax error, and B has nothing to do with
hashes (and is also a syntax error if you use strict).

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: date comparioson in a Case statement
    ... Both "NA" and e_dt have to be the same datatype. ... > I have a case statement where I am comparing two dates ... > Syntax error during implicit conversion of VARCHAR value 'NA' to a ...
    (microsoft.public.sqlserver.programming)
  • Re: code help
    ... There is no syntax error there. ... That's a great way to confuse a newby. ... arguments" but you are comparing the variable to 1? ...
    (comp.lang.perl.misc)