use strict;
use lib qw(./lib);
use Spreadsheet::WriteExcel;
use Math::Random qw(:all);
$worksheet->write(0, 0, "Zahl", $format);
$worksheet->write(0, 1, "Vorkommt",$bold);
my @rand_arr = map int,random_normal(10,5,5);
my ($temp,$count) = ("@rand_arr", 0);
($count = $temp =~ s/($_)//g) and printf "%2d:%s vor.\n", $_,$count for @rand_arr;
$worksheet->write(1, 0, "$_");
$worksheet->write(1, 1, "$count");
$workbook->close();
print "\n";
如果您这样做,您将在终端中获得良好的输出,但我想做的是,在 Excel 中获得相同的输出,我认为我的问题就在这里
$worksheet->write(1, 0, "$_");
$worksheet->write(1, 1, "$count");
我不知道如何让 excel 单独使用 $ROW++ ..