package GridFiller::Scaler; use Moose; use namespace::autoclean; use GridFiller::Types qw(GridT); use MooseX::Types::Moose qw(Int); use Carp; use MooseX::Params::Validate 'pos_validated_list'; sub scale { shift; # class my ($input_grid,$scale) = pos_validated_list( \@_, { isa => GridT }, { isa => Int }, ); my @output_grid; for my $row (@$input_grid) { my @out_row; for my $cell (@$row) { push @out_row, $cell for 1..$scale; } push @output_grid,[@out_row] for 1..$scale; } return \@output_grid; } 1; __END__ =head1 AUTHOR Gianni Ceccarelli =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2012 by Gianni Ceccarelli. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. =cut