GPUtils: automatically add lib-dir to @INC

git-svn-id: https://svn.fhem.de/fhem/trunk@6647 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess
2014-10-01 10:15:22 +00:00
parent 55c0bdbbac
commit f5aeae71a3

View File

@@ -10,6 +10,15 @@ use warnings;
our %EXPORT_TAGS = (all => [qw(GP_Define GP_Catch GP_ForallClients)]);
Exporter::export_ok_tags('all');
#add FHEM/lib to @INC if it's not allready included. Should rather be in fhem.pl than here though...
BEGIN {
if (!grep(/FHEM\/lib$/,@INC)) {
foreach my $inc (grep(/FHEM$/,@INC)) {
push @INC,$inc."/lib";
};
};
};
sub GP_Define($$) {
my ($hash, $def) = @_;
my @a = split("[ \t]+", $def);