Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: how to detect gtk installed or not

by Athanasius (Chancellor)
on Jan 13, 2013 at 14:39 UTC ( #1013108=note: print w/replies, xml ) Need Help??

in reply to how to detect gtk installed or not

One way is to eval the appropriate require:

#! perl use Modern::Perl; my $r1 = eval "require Data::Dumper"; my $r2 = eval "require Non::Exist"; say $_ ? "found" : "missing" for ($r1, $r2);

which on my system prints:

0:35 >perl found missing 0:37 >

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: how to detect gtk installed of not
by sdetweil (Sexton) on Jan 13, 2013 at 14:46 UTC
    thanks.. unfortunately, my require is against wxPerl, and not any of the underlying system support that wx Requires.

    if I try to start this app, I get a missing DLL/SO error message, which I am trying to suppress as it doesn't help my users at all.

    using Load for wxPerl is really difficult to get working.

      This means that however you tried to install wxPerl, it was a broken attempt. If the wxPerl module were installed properly, or missing completely, require should either work or fail, but not pop up a "SO missing" message.

      But maybe you can be a bit more explicit about how things fail for you, by posting a short, self-contained snippet together with the error messages. That would likely help us to help you better.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013108]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2018-05-28 00:10 GMT
Find Nodes?
    Voting Booth?