question from a newbie. How do I include a code fragment in a perl script so it first gets included and then interpreted/compiled?
Ok. that's the short question. In other words, this is what I am trying to do -- I have one index.pl (this is a web app), and everything passes through this. So, if the call is to index.pl?do=login then the login page is included, if the call is to index.pl?do=verify then the verify page is included. This is how I work in the world of other web programming (Cold Fusion, PHP, etc.). This way I have to declare all my use statements (to import packages), other declarations, param checking, etc. in one place. I also have one master template, and everything else is simply included... bunch of perl html html html require $do; html html html Except, if I do "require" then $do is evaluated outside this page, and hence doesn't get any of the local variables. What am I not aware of here? On more general terms I need some advice. Although I have been building web applications for several years now, I have discovered the joy of Perl only recently (few months) and am totally enamored by it. I don't really want to get good at CGI.pm because it is simply a replacement for the html abomination, but since I am used to the html abomination, CGI.pm is basically a pain in the derriere for me. I miss the embeddability of other languages, so it makes me covet embperl. Question -- is there anything wrong with coveting embperl, any downsides? Are there other ways of doing things? tia, pk/