|go ahead... be a heretic|
Declaring a code ref with argumentsby !unlike (Beadle)
|on Aug 05, 2003 at 08:51 UTC ( #280921=perlquestion: print w/replies, xml )||Need Help??|
!unlike has asked for the wisdom of the Perl Monks concerning the following question:
I have written a multipage CGI script using the technique described in recipe 19.12 of the Perl Cook book. Namely put all the HTML generation/program logic in subroutines and store those subs as values of a hash.
This all works fine until you need to pass an argument when declairing the code ref within the hash. When this is done the subroutine is executed (I assume this has to be done because the sub has to be exaluated because of the arg).
This totally breaks my multipage CGI script as one page is only ever displayed. How do I fix this?
Here is an example that demonstrates the problem:
Hello World, again!\n";
I'm using Perl 5.6.1 on Linux
I write my Perl code like how I like my sex: fast and dirty. ;)
Back to Seekers of Perl Wisdom