in reply to Unused variable in HTML::Template results in blank screen

Abstraction solved the symptom, antirice showed how to find the problem ... i just want to show you how to indent your code:
# fill in some parameters in the template $template->param(Number => $Number); $template->param(new => $new); $template->param(story => $story); $template->param(id_no => $id_no); $template->param(message_no => $message_no); if (($check == '0') or ($check == '3') or ($check == '4')) { $template->param(tart => $tart); $template->param(ear => $ear); $template->param(mouth => $mouth); }
There is no excuse for not finding a style of code indentation and sticking to it. No excuse, especially when you present that code to others for review. It's really hard to tell which lines belong in a block if you don't use indentation. And please don't use the excuse everyone gives: "Well, i was going to go back and put indentation in later ..." ... do it now.

And if you don't know how to indent your code properly, then by all means let Perltidy decide for you. I would rather all newcomers use Perltidy to indent their code than have them just slam stuff to us. Oh and by the way ... HTML::Template::param() accepts a list, so you can say stuff like:

# fill in some parameters in the template $template->param( Number => $Number, new => $new, story => $story, id_no => $id_no, message_no => $message_no, );
Hope this helps. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Unused variable in HTML::Template results in blank screen
by jonnyfolk (Vicar) on Aug 09, 2003 at 14:44 UTC
    No excuses - I accept the smacked botty. I do indent generally, and am not sure why I didn't in this case. All part of the learning curve, I suppose.

    I'm very interested in what you say about param() accepting a list as this point doesn't come out in Sam Tregar's explanation he uses the code as I do (tho' with impeccable indentation):

    # fill in some parameters in the template $template->param(home => $ENV{HOME}); $template->param(path => $ENV{PATH});
    So thanks very much for that.