diff -up collectl-3.5.1/readS.orig collectl-3.5.1/readS --- collectl-3.5.1/readS.orig 2011-08-02 10:51:09.000000000 +0200 +++ collectl-3.5.1/readS 2011-08-02 10:56:35.000000000 +0200 @@ -5,7 +5,7 @@ # readS may be copied only under the terms of either the Artistic License # or the GNU General Public License, which may be found in the source kit -use Switch; +use feature qw(switch); use Getopt::Std; my $Version= '1.0'; @@ -75,13 +75,13 @@ while ($catvar ne '+') print " Oper: $oper Expr: $expr Leftover: $catvar\n" if $debug; # take appropriate action, aborting when unkown operator - switch ($oper) + given ($oper) { - case '+' { $result+=$value; } - case '-' { $result-=$value; } - case 'X' { $result*=$value; } - case '/' { $result/=$value; } - else { error("Unkown operator '$oper', aborting..."); } + when ('+') { $result+=$value; } + when ('-') { $result-=$value; } + when ('X') { $result*=$value; } + when ('/') { $result/=$value; } + default { error("Unkown operator '$oper', aborting..."); } } print " Value: $value Subtotal: $result\n" if $debug; }