... my $o = ""; foreach ( @array ) { $o .= $_.' '; } print $o."\n"; #### ... my $o = ""; foreach ( @array ) { $o .= $_; } print $o."\n"; #### my $c = 0; sub FETCH { my $self = shift; my $index = shift; $c++; print STDERR "Call ($c) fetching the element with index: $index\n"; return $self->[ $index ].$c; }