Commits

Shlomi Fish committed f639e3f

Some cleanups to the perl code.

  • Participants
  • Parent commits 091b283

Comments (0)

Files changed (1)

File src/wml_backend/p1_ipp/ipp.src

     &usage;
 }
 #   Adjust the -M flags
-if ($opt_M !~ m%^(-|[MD]*)$% && $#ARGV == -1) {
+if ($opt_M !~ m%^(-|[MD]*)$% && (! @ARGV)) {
     push(@ARGV,$opt_M);
     $opt_M = '';
 }
-&usage if ($#ARGV == -1);
+&usage if (! @ARGV);
 push(@opt_I, '.');
 
 #
             @ls = reverse @ls if ($arg{'IPP_REVERSE'});
 
             #   and truncate it
-            if ($arg{'IPP_MAX'} =~ m/^\d+$/ and $arg{'IPP_MAX'} < $#ls + 1) {
-                splice (@ls, $arg{'IPP_MAX'} - $#ls - 1);
+            if ($arg{'IPP_MAX'} =~ m/^\d+$/ and $arg{'IPP_MAX'} < @ls) {
+                splice (@ls, $arg{'IPP_MAX'} - scalar(@ls));
             }
             push (@ls, "");