$row2 = 44; $col2 = 4; my $width = 4; for my $device (@device){ my $text = $workbook1->add_shape( type => 'rect', text => $device, line=>1 ); $worksheet2->insert_shape( $row2, $col2, $text ); $col2 += $width; } $workbook1->close();