Firstly, apologies for the double posting of this question. 

On Wed, 01 Apr 2009 09:49 +0200, "Thomas Bätzler"
<t.baetz...@bringe.com> wrote:
> How about (untested):
> 
> sub display_board {
>   foreach my $ref (@_){
>     foreach my $piece ( @$ref ){
>       print substr( $piece, -2);
>     }
>   }
> }
> 
> The Perl way is to avoid using indices where you don't need them.

Yes, that works fine, and is far more elegant.

Thanks,
Richard

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to