foreach my $MIS_SHEET (@tables) { # Get the first worksheet. my $sheet = $template->worksheet($MIS_SHEET);