in reply to Re^2: $str to %hash to @ary
in thread $str to %hash to @ary

nice test
you may try also this one:

ccn_fast => sub { my $rand = rand 100; my $mystr = $str; # this line is needed for repetitive test on +ly 1 while $mystr =~ /([^:]+):([^:]+):?/g and (($rand -= $1) > 0) +; $2; },

Replies are listed 'Best First'.
Re^4: $str to %hash to @ary
by fizbin (Chaplain) on Jul 25, 2004 at 03:11 UTC
    Nice (see my reply to Lymbic~Region); that's fast. In multiple trials, it gets even faster (by ~ 20%) if you don't use a separate variable but instead reset pos($str)
    -- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/