]> jspc29.x-matter.uni-frankfurt.de Git - coral.git/commitdiff
reeeeally tidied up the whole require shit
authorMichael Wiebusch <m.wiebusch@gsi.de>
Thu, 15 Jan 2015 17:48:02 +0000 (18:48 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Thu, 15 Jan 2015 17:48:02 +0000 (18:48 +0100)
user_interface/coral_scanner.pm
user_interface/misc_subs.pm
user_interface/pmt_ro.pm
user_interface/settings_subs.pm
user_interface/table_control.pm

index 904c6d29f5218c7ffd84d78379e52a8d22a84432..5cf8c720d4396eb52d8f1213498485586c626ccd 100644 (file)
@@ -12,14 +12,14 @@ use SVG;
 
 use CGI ':standard';
 
-require settings_subs;
+use settings_subs;
 # our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
 
 
-#use pmt_ro;
-#use table_control;
+use pmt_ro;
+use table_control;
 
-require misc_subs;
+use misc_subs;
 
 ## methods
 
@@ -53,8 +53,8 @@ sub new {
   };
   bless($self, $class);
   
-  #$self->{pmt_ro} = pmt_ro->new();
-  #$self->{pmt_control} = table_control->new();
+  $self->{pmt_ro} = pmt_ro->new();
+  $self->{pmt_control} = table_control->new();
   
   return $self;
 }
@@ -89,7 +89,7 @@ sub main_html {
   
   print "<p id='show_pmt_ro_settings' class='quasibutton' >pmt_ro settings</p>";
   print "<div id='pmt_ro_settings_container' class='stylishBox hidden_by_default'>";
-  $self->settings_form();
+  $self->{pmt_ro}->settings_form();
   print "</div>";
   
   
index faee1a2923c0349a10330f216c680229356814a1..18c951d948b18f0c3b9e95e67b0bcb533f63356e 100644 (file)
@@ -1,5 +1,18 @@
+package misc_subs;
 
 
+BEGIN {
+  require Exporter;
+  # set the version for version checking
+  our $VERSION = 1.00;
+  # Inherit from Exporter to export functions and variables
+  our @ISA = qw(Exporter);
+  # Functions and variables which are exported by default
+  our @EXPORT = qw(printHeader min max echo require_run test);
+  # Functions and variables which can be optionally exported
+  #our @EXPORT_OK = qw($Var1 %Hashit func3);
+}
+
 sub test {
   my $self = shift;
   my %options = @_;
index 73a4858966cfd487014a4d4a6c555fb6c8c5c629..653d4ef16cea0eeac2df44302357c9427f8093cb 100644 (file)
@@ -9,8 +9,8 @@ use POSIX;
 use FileHandle;
 use regio;
 
-require settings_subs;
-require misc_subs;
+use settings_subs;
+use misc_subs;
 
 ## methods
 
index 0660130f789fbd05aa382730c4ebb945c4782d71..8763611785fa0a97d66cd37e0eb3915d571cd702 100644 (file)
@@ -1,8 +1,21 @@
-
+package settings_subs;
 use Storable qw(lock_store lock_retrieve);
-require misc_subs;
+use misc_subs;
+
 
 
+BEGIN {
+  require Exporter;
+  # set the version for version checking
+  our $VERSION = 1.00;
+  # Inherit from Exporter to export functions and variables
+  our @ISA = qw(Exporter);
+  # Functions and variables which are exported by default
+  our @EXPORT = qw(load_settings save_settings reset_settings settings_form);
+  # Functions and variables which can be optionally exported
+  #our @EXPORT_OK = qw($Var1 %Hashit func3);
+}
+
 
 sub load_settings {
   my $self=shift;
index c81be4813e2e3ef4477bac602718ab2255c77836..6bbae0d7006138642515ecc82e7947352ed3bd3d 100644 (file)
@@ -14,8 +14,8 @@ use CGI;
 
 # use has_settings;
 # our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
-require settings_subs;
-require misc_subs;
+use settings_subs;
+use misc_subs;
 
 
 ## methods