in reply to change value in run time

But I think it's also ugly.

Then spread it out a bit.

map { my $range = 'A'.$count.':B'.$count; $count++; $sheet->Range($range)->{'Value'} = $_; } @$retrieve_ref;

Your useless use of map isn't helping. Let's get rid of it

for ( @$retrieve_ref ) { my $range = 'A'.$count.':B'.$count; $count++; $sheet->Range($range)->{'Value'} = $_; }

The latter is even more efficient.