From 324000ceb51820b534cfaa507b40d4b65600ee1e Mon Sep 17 00:00:00 2001 From: Lieven Hollevoet Date: Sun, 15 Nov 2015 18:21:36 +0100 Subject: [PATCH] Only include the PLCBUS module if we actually need it. Otherwise we require users to install supporting modules for PLCBUS. --- lib/read_table_A.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/read_table_A.pl b/lib/read_table_A.pl index 9cefde9b8..8bc91e2c0 100644 --- a/lib/read_table_A.pl +++ b/lib/read_table_A.pl @@ -1166,10 +1166,12 @@ sub read_table_A { } #-------------- End AD2 Objects ------------- elsif($type =~ /PLCBUS_.*/){ - use PLCBUS; $packages{PLCBUS}++; ( $address, $name, $grouplist, @other) = @item_info; ($object,$grouplist,$additional_code) = PLCBUS->generate_code($type, @item_info); + if( ! $packages{PLCBUS}++ ) { # first time for this object type? + $code .= "use PLCBUS;\n"; + } } else { print "\nUnrecognized .mht entry: $record\n";