next if ($element eq $compare); #### ($front, $back) = split /:/, $compare; if ( $compare =~ /:$back$/ ) { # do something } #### $moduloc = () = $compare =~ /X(\d+):/; # Grab the divisor. $moduloe = () = $element =~ /X(\d+):/; # Grab the other one. next if ( not $modulo ); # otherwise zero always matches. if ( not ($moduloe)%($moduloc) ) { # Do something. }