uniq ( '192345810' ) == 1 ? print "1\n" : print "0\n"; sub uniq { ($result) = ($_[0] =~ m[((.).*\2)]); print "result: $result; captured: $1\n"; }