in reply to Troubles when trying to use Tk conditionally

Use MainLoop(). The parenthesis force the perl compiler see the identifier as a subroutine name, not a bareword.

Replies are listed 'Best First'.
Re^2: Troubles when trying to use Tk conditionally
by elef (Friar) on Feb 04, 2011 at 15:12 UTC
    Thank you, that works.
    I wrote it as bart says: it doesn't get called when no Tk module is available, so there's no error thrown there, either.