rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | #!/usr/local/bin/perl |
2 | |||||
3 | |||||
4 | my $count; | ||||
5 | my $repeated=0; | ||||
6 | |||||
7 | |||||
8 | my @in_var = @ARGV; | ||||
9 | |||||
10 | my @new_var; | ||||
11 | |||||
12 | foreach $a (@in_var) | ||||
13 | { | ||||
14 | $count =0; | ||||
15 | #print "var_a=$a \n"; | ||||
16 | |||||
17 | foreach $b (@in_var) | ||||
18 | { | ||||
19 | if ( "$a" eq "$b" ) | ||||
20 | { | ||||
21 | $count++; | ||||
22 | |||||
23 | } | ||||
24 | } | ||||
25 | |||||
26 | if ($count==0) | ||||
27 | { | ||||
28 | |||||
29 | } elsif ( $count > 1) | ||||
30 | { | ||||
31 | print "$a repeated $count times ! \n"; | ||||
32 | |||||
33 | $repeated++; | ||||
34 | } | ||||
35 | |||||
36 | } | ||||
37 | |||||
38 | exit $repeated; | ||||
39 | |||||
40 | |||||
41 | |||||
42 |