#!/usr/bin/perl -w use strict; while ( <> ) { chomp; die unless /^\d{10}$/; &uniq ( $_ ) == 1 ? print "1\n" : print "0\n"; } sub uniq { my $x = $_[0]; my @x = sort split //, $x; $x = join "", @x; $x =~ tr/0-9//s; length $x == 10 ? return 1 : return 0; }