#!/usr/local/bin/perl -w use strict; use Benchmark; my $count =500000; ## Method number one sub One { my $data = 'for bar baz'; $data = uc $data; } ## Method number two sub Two { my $data = 'for bar baz'; $data =~ tr/a-z/A-Z/; } ## Method number Three sub Three { my $data = 'for bar baz'; $data =~ s/([A-Za-z]+)/uc($1)/ge; } ## We'll test each one, with simple labels timethese ( $count, {'Method One UC' => '&One', 'Method Two TR' => '&Two', 'Method Three s'=> '&Three' } ); exit;