xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
I have a script to retrieve some data from database and fill in a excel file:
..... ..... my $retrieve_ref = $sbh->fetchall_arrayref; map {$sheet->Range('A'.$count.':B'.$count)->{'Value'} = $_; $count +++;} @$retrieve_ref;
My question is I'm tired to write 'A'.$count.':B'.$count, I wanna define a variable which value could be changed dynamically according to value of $count.(Yes, I can say:)
But I think it's also ugly.map {my $range = 'A'.$count.':B'.$count; $sheet->Range($range)->{'Valu +e'} = $_; $count++;} @$retrieve_ref;
Just some wild thought, hope gurus could give insights!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: change value in run time
by kyle (Abbot) on Oct 23, 2008 at 16:08 UTC | |
by xiaoyafeng (Deacon) on Oct 23, 2008 at 16:52 UTC | |
|
Re: change value in run time
by JavaFan (Canon) on Oct 23, 2008 at 16:29 UTC | |
|
Re: change value in run time
by Corion (Patriarch) on Oct 23, 2008 at 19:03 UTC | |
|
Re: change value in run time
by ikegami (Patriarch) on Oct 23, 2008 at 18:40 UTC | |
|
Re: change value in run time
by mje (Curate) on Oct 23, 2008 at 16:21 UTC | |
by xiaoyafeng (Deacon) on Oct 23, 2008 at 16:30 UTC | |
|
Re: change value in run time
by Tanktalus (Canon) on Oct 23, 2008 at 22:39 UTC |