develooper Front page | perl.beginners | Postings from April 2002

Re: assigning array to hash

Thread Previous | Thread Next
From:
drieux
Date:
April 29, 2002 21:22
Subject:
Re: assigning array to hash
Message ID:
DBB217F4-5BF1-11D6-B140-0030654D3CAE@wetware.com

On Monday, April 29, 2002, at 08:29 , Chas Owens wrote:

>
> TMTOWTDI:
>
> my @array = qw(first second last);
> my %hash;
> #the $" var controls what characters separate elements of
> #an interpolated array
> { local $" = '|'; $hash{somekey} = "@array"; }

can You get Your Brilliant Flashes in Gear....

remember that you need to remind folks that this deconstructs with:

	my @chas_array =  split(/\|/, $hash{$chas});

updated:

http://www.wetware.com/drieux/CS/lang/Perl/Beginners/BenchMarks/loopVjoin.
txt

actually it's in the contenders list....

Geez Chas, If you're Gonna Whine - whould you get there on time:
Benchmark: timing 50000 iterations of aref, chasNeff, j2ref, join, join2, 
jref, loop, loop3...
   chasNeff: 56 wallclock secs (51.34 usr +  0.00 sys = 51.34 CPU) @ 973.90/
s (n=50000)
       join: 55 wallclock secs (49.95 usr +  0.00 sys = 49.95 CPU) @ 
1001.00/s (n=50000)
      join2: 55 wallclock secs (51.08 usr +  0.00 sys = 51.08 CPU) @ 978.86/
s (n=50000)
       jref: 35 wallclock secs (31.69 usr +  0.00 sys = 31.69 CPU) @ 
1577.78/s (n=50000)

......

ciao
drieux

---

Come on Chas - what is it, some outside experience,
some hot date that takes precedence over Perl.....


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About