http://www.perlmonks.org?node_id=1030731


in reply to Re: variable in variables
in thread variable in variables

Ok, that handles an initialization of the worksheet, but how do I do the worksheets writes outside of a for loop? An adhoc write to another element?

As my example, How do I assign a "person" and then be able to do my write as my example showed?

Replies are listed 'Best First'.
Re^3: variable in variables
by eyepopslikeamosquito (Archbishop) on Apr 25, 2013 at 20:52 UTC

    how do I do the worksheets writes outside of a for loop?
    Old:
    $NAME = "BOB"; $worksheet_$NAME->write('A2', "$NAME is here");
    New:
    $NAME = "BOB"; $worksheets{$NAME}->write('A2', "$NAME is here");

    BTW, as for why symbolic references should be avoided, see the classic three part series by MJD: part 1 and part 2 and part 3.