Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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
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 exploiting the Monastery: (2)
As of 2014-09-21 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls