in reply to Problem with an array in a package
and# Page Layout - Legal, Landscape our %landscape_lgl = ( set_paper => [5], set_landscape => [], set_margins_LR => [.50], set_center => [], set_hide_gridlines => [], set_fit_to_pages => [] );
This will not preserve the order of your statements in the %landscape_lgl hash. If you need to do that, have a separate array:foreach my $statement (keys(%landscape_lgl)) { $worksheet->$statement(@{$landscape_lgl{$statement}}), print "$worksheet->$statement","\n"; }
And use that in place of the keys() part.@landscape_lgl = qw/set_paper set_landscape.../
Alternatively, keep your original loop, but instead of the $worksheet->$statement call in the foreach body, use
All code untested.eval $statement; warn "something went wrong in $statement: $@" if $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem with an array in a package
by jcoxen (Deacon) on Jan 14, 2004 at 20:06 UTC |