in reply to My philosophy on coding (in Perl and other languages):

I agree with all your points with a slight rephrasing to the first point. How about 'use references when they are the best solution to the problem'. Consider the following benchmark.
use Benchmark; my @big_array = (1 .. 10000); sub ret_array { return @big_array; } sub ret_ref { return \@big_array; } timethese(10000, { 'return_array' => sub { my @array = ret_array(); }, 'return_ref' => sub { my $array_ref = ret_ref(); } });
Which yeilds:
Benchmark: timing 10000 iterations of return_array, return_ref... return_array: 120 wallclock secs (117.82 usr + 1.65 sys = 119.47 CPU) return_ref: 0 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 CPU)
Returning the reference is faster since it doesn't have to copy each element, allocate memory for it, etc. Granted it can make your code more cryptic, but in the cases where the returned array is large, or the subroutine is called often, the speed increase is well worth it.

/\/\averick