Micheal, try this"
$x = "A"; foreach $list(@list) { $cell = "$x{1}"; //you can't just put a suffix to a variable when you print it..perl will think //you mean $x1.. use $x{whateveryouwanttoadd} for example... $num = 4; print "$sun{th}"; //to make it 4th $worksheet->write($cell, $list); $x++; } hope that works for you.. ~Eric On Monday, April 1, 2002, at 04:03 PM, Michael Stearman wrote: > It could be my code. I am using the variable to write to an Excel file > in which I want to increment the cell from A1 to B1 to C1, etc. > > $x="A"; > foreach $list(@list) { > $cell="$x1"; > $worksheet1->write($cell, $list); > $x++; > } > > >> From: "Michael Stearman" <[EMAIL PROTECTED]> >> To: [EMAIL PROTECTED] >> Subject: Increment a Variable >> Date: Mon, 01 Apr 2002 20:50:31 +0000 >> >> Hi, >> >> I was wondering if anyone knew how to increment a variable when the >> variable >> is a letter. For example >> >> $x="A"; >> $x++; >> >> doesn't work. I'm trying to get $x="B"; >> >> Thanks, >> Mike. >> >> >> >> _________________________________________________________________ >> Get your FREE download of MSN Explorer at >> http://explorer.msn.com/intl.asp. >> >> >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at > http://explorer.msn.com/intl.asp. > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]