in reply to Re: list of scalars vs arrays, speed?
in thread list of scalars vs arrays, speed?

Order? The subs are passed as a hashref, user has no control over order. He'd have to call timethis twice.

--
perl -pew "s/\b;([mnst])/'$1/g"

  • Comment on Re: Re: list of scalars vs arrays, speed?

Replies are listed 'Best First'.
Re: Re: Re: list of scalars vs arrays, speed?
by dws (Chancellor) on May 02, 2002 at 06:27 UTC
    He'd have to call timethis twice.

    How, exactly, is that a problem?

      Oh, it's not a problem. However the way you worded your response did not acutally convey that that was what you were suggesting. Taking your comment literally one might naively do:
      @base=qw/one two three four five six seven/; timethese(1_000_000,{ '@'=>sub{@s=@base;} '$'=>sub {($s1,$s2,$s3,$s4,$s5,$s6,$s7)=@base;}, });

      --
      perl -pew "s/\b;([mnst])/'$1/g"