Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Troubles when trying to use Tk conditionally

by elef (Friar)
on Feb 04, 2011 at 17:41 UTC ( #886260=note: print w/ replies, xml ) Need Help??


in reply to Troubles when trying to use Tk conditionally

What if I wanted to allow non-Windows users to use the Tk gui if they are willing to install Tk themselves?
Could I just do if ($gui eq "on") {require Tk} and simply sidestep compile-time checking of the module's availability? I could set the $gui variable based on the platform *and* the user's settings.


Comment on Re: Troubles when trying to use Tk conditionally
Download Code
Replies are listed 'Best First'.
Re^2: Troubles when trying to use Tk conditionally
by elef (Friar) on Feb 05, 2011 at 15:29 UTC
    I did some testing, if ($gui eq "on") {require Tk;import Tk} works fine so far.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://886260]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2015-07-28 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls