InfiniteSilence has asked for the wisdom of the Perl Monks concerning the following question:

I am reading the O'Reilly book: Practical Internet Groupware by John Udell and am having problems with the httpd server on Win32, particularly the following line:
if (defined &{$fn}) { &{$fn}($args); } else { $main::debug && print STDERR "(engine) undefined function $f +n"; } }
The script prints out the debug message about not being able to find the function &Engine::PubUtils:do_engine_serve_file but it is there all right and I can access it from the command like like so:
perl -e "use Engine::PubUtils; Engine::PubUtils::Engine::PubUtils:do_e +ngine_serve_file;"
Anyone else having problems like this on Win32?

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re: httpd script weirdness
by wog (Curate) on Jun 09, 2001 at 01:12 UTC
    The code there doesn't seem to do a require to get the module. Thus, the function doesn't exsit at that point. You could add a use Engine::PubUtils; to the top of the script, or maybe modify the script to auto-require the module the function is in, and then trying it.

    Of course, it probably still won't work if the module in question autoloads that function.

Re: httpd script weirdness
by InfiniteSilence (Curate) on Jun 11, 2001 at 20:38 UTC
    The previous code was extracted from the PubUtils module. I did not want not want to post the actual module for two reasons: a) the author did not include any perldoc information indicating redistribution b) it is relatively long.

    I am going to see if I can contact the author for permission to post it.

    Update: Here's the link...(http://udell.roninhouse.com/examples/dhttp-v2.tar.gz)

    Celebrate Intellectual Diversity