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 478_SoPW.pl found missing 0:37 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: how to detect gtk installed or not
by Athanasius
in thread how to detect gtk installed or not
by sdetweil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |