in reply to Re: Crazy Golf : creating hex ranges from non-consecutive hex data values
in thread Crazy Golf : creating hex ranges from non-consecutive hex data values

@hexv = (@hexv,@vals) Really!? Haven't you heard of push?

Lets see, perfectly legal syntax, perfectly understandable, and its faster than push

  • Comment on Re^2: Crazy Golf : creating hex ranges from non-consecutive hex data values

Replies are listed 'Best First'.
Re^3: Crazy Golf : creating hex ranges from non-consecutive hex data values
by jwkrahn (Abbot) on Aug 01, 2011 at 05:29 UTC

    Faster?

    $ perl -le' use Benchmark qw/ cmpthese /; my @data = "a" .. "z"; cmpthese -4, { copy => sub { my @array; @array = ( @array, @data ) for 1 .. 10; r +eturn @array }, push => sub { my @array; push @array, @data for 1 .. 10; return @a +rray }, } ' Rate copy push copy 908/s -- -91% push 9660/s 964% --

    Can you prove it?