]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
compatible with newer Perl version
authorHadaq Hades <hadaq@lxhadesdaq>
Wed, 7 Feb 2018 17:37:54 +0000 (18:37 +0100)
committerHadaq Hades <hadaq@lxhadesdaq>
Wed, 7 Feb 2018 17:37:54 +0000 (18:37 +0100)
main/startup.pl

index 1d7068c56ef8452fd3eaaa232a4d3d5a0fff9065..fbf4064b90260886b8b11e13d2cf0bc9568a5e7a 100755 (executable)
@@ -605,13 +605,13 @@ sub add2startup(){
     die "add2startup(): one or more arguments are not defined! Exit.\n"
         unless( defined $subsys && defined $exec_sys && defined $cmd && defined $aref);
     
-    if(    $cmd =~ /exec_script{(\w+)}/ ){
+    if(    $cmd =~ /exec_script\{(\w+)\}/ ){
         my $exec_sys = $1;
 
         #- exec_script is followed only by one parameter [0]: script name
         &readScript( $aref->[0], $exec_sys );
     }
-    elsif( $cmd =~ /exec_cmd{(\w+)}/){
+    elsif( $cmd =~ /exec_cmd\{(\w+)\}/){
         my $exec_sys = $1;
 
         my $args = &getArgs4cmd($aref, $subsys);
@@ -1018,7 +1018,7 @@ sub cpThresholds()
                             }
                             {$THRPATH}gxms;    # ...with lxhadesdaq path
 
-                if( $thresh =~ /\${TRBNUM}/ ){
+                if( $thresh =~ /\$\{TRBNUM\}/ ){
                     foreach my $trb ( @{$trb_href->{$exec_sys}} ){
                         my $trbnum = 0; #default
                         if( $trb =~ /etraxp?(\d{3})/ || $trb =~ /trb?\d(\d{2})/){
@@ -1030,7 +1030,7 @@ sub cpThresholds()
 
                         #- replace TRBNUM
                         $thresh =~ s{                # Substitue ...
-                                      \${TRBNUM}     # ... a parameter
+                                      \$\{TRBNUM\}     # ... a parameter
                                     }
                                     {$trbnum}gxms;   # ... with a TRB number
 
@@ -1095,19 +1095,19 @@ sub cmdParam(){
     
     #- replace TRBNUM
     $cmd =~ s{                # Substitue...
-               \${TRBNUM}     # ...a parameter
+               \$\{TRBNUM\}     # ...a parameter
              }
              {$trbnum}gxms;   # Raplace it with a TRB number
         
     #- replace EBIP
     $cmd =~ s{                # Substitue...
-               \${EBIP}       # ...a parameter
+               \$\{EBIP\}       # ...a parameter
              }
              {$eb_ip}gxms;    # Raplace it with a EB IP    
 
     #- replace EBPORT
     $cmd =~ s{                # Substitue...
-               \${EBPORT}     # ...a parameter
+               \$\{EBPORT\}     # ...a parameter
              }
              {$eb_port}gxms;  # Raplace it with a EB PORT 
     
@@ -1509,7 +1509,7 @@ sub rmDeadHosts()
     
     foreach my $sys (%$trb_href){
 
-        next unless( defined @{$trb_href->{$sys}} && $#{$trb_href->{$sys}} > 0 );
+        next unless( @{$trb_href->{$sys}} && $#{$trb_href->{$sys}} > 0 );
 
         foreach my $host (@$dead_hosts_aref){
             @{$trb_href->{$sys}} = grep { !($_ eq $host) } @{$trb_href->{$sys}};