in reply to unable to use interpolation in for loop for writing in excel

I see no error in the snippet you posted. Most likely your error is that $s_counter already has a value larger than $permanent_counter before you hit your loop, so your loop never gets executed.

Using lexical variables avoids the problem of forgetting to initialize loop counters. The strict pragma tells Perl that you want to pre-declare all variables:

use strict; my ($s_counter); until ($s_counter == $permanent_counter) { $Sheet->Cells(1,1)->{Value} = "somevalue"; $s_counter=$s_counter+1; }

Alternatively, you can continue with the problematic programming style you currently have, by explicitly initializing $s_counter before your loop:

$s_counter = 0; until ($s_counter == $permanent_counter) { $Sheet->Cells(1,1)->{Value} = "somevalue"; $s_counter=$s_counter+1; }