#!/usr/bin/perl # # $Id: for-vs-eval 2592 2003-12-21 00:33:01Z jmates $ # # The author disclaims all copyrights and releases this document into # the public domain. use Benchmark qw(cmpthese); @a = qw(1 2 3); cmpthese(-5, { 'eval' => '$s = eval join "+", @a;', 'for' => '$s+=$_ for @a;', });