#!/usr/bin/perl -w use strict; while ( <> ) { chomp; die unless /^\d{10}$/; &uniq ( $_ ) == 1 ? print "1\n" : print "0\n"; } sub uniq { for ( 0 .. 9 ) { return 0 if $_[0] !~ /$_/; } return 1; }