in reply to Re: fork and exec a codeblock
in thread fork and exec a codeblock

require Tk; ... MainLoop;
That's not going to work. Since the sub isn't declared at the time "MainLoop;" is compiled, it is a bareword (and the use strict will make it die with 'Bareword "MainLoop" not allowed while "strict subs" in use').

In general you can't just replace use with require without other changes. In this case, I think saying &MainLoop(); is the only needed change. Update: and add an import Tk; after the require.

Replies are listed 'Best First'.
Re^3: fork and exec a codeblock
by Aristotle (Chancellor) on Mar 16, 2004 at 19:45 UTC

    Good catch. Actually, &MainLoop(); will still be an error since require doesn't give the module a chance to export anything, and you either have to do that manually or prefix things with the right package.

    Of course, none of this has much to do with the forking question..

    Makeshifts last the longest.