Re: using modules only when available

2003-10-27 Thread Steve Grazzini
On Mon, Oct 27, 2003 at 03:21:50PM -0700, Wiggins d Anconia wrote: > > This is what I tried: > > > > eval "use Tk"; > > I would have thought in this case you would want the BLOCK form of > 'eval' rather than the EXPR form? Or does it matter? Gurus can you > expound on the differences in this ca

RE: using modules only when available

2003-10-27 Thread Bakken, Luke
> I would have thought in this case you would want the BLOCK form of > 'eval' rather than the EXPR form? Or does it matter? Gurus can you > expound on the differences in this case? > > Give: > > eval { use Tk }; > if ($@) { > # module not ok, etc. > } > > A try. perldoc -f eval > > http://d

Re: using modules only when available

2003-10-27 Thread Wiggins d Anconia
> This is what I tried: > > eval "use Tk"; >if ($@) { > $notk = 1; >} > > Now, on machines where Tk doesn't exist, it works fine. On machines where Tk > does exist, the program exits silently when I begin to use Tk. > > Perhaps there is a caveat with using this with Tkany ide

Re: using modules only when available

2003-10-27 Thread Phil Schaechter
This is what I tried: eval "use Tk"; if ($@) { $notk = 1; } Now, on machines where Tk doesn't exist, it works fine. On machines where Tk does exist, the program exits silently when I begin to use Tk. Perhaps there is a caveat with using this with Tkany ideas, anyone? -Phil >

RE: using modules only when available

2003-10-27 Thread Bob Showalter
Phil Schaechter wrote: > I have a program that has an optional GUI which makes use of > Tk. On machines > without Tk, the program errors out looking for the Tk > modules. Currently, I > am just saying > > use Tk; > > Is there some method I can use that will prevent it from > dying in the event

using modules only when available

2003-10-27 Thread Phil Schaechter
I have a program that has an optional GUI which makes use of Tk. On machines without Tk, the program errors out looking for the Tk modules. Currently, I am just saying use Tk; Is there some method I can use that will prevent it from dying in the event Tk is not on the current machine? Or, i