#!perl -w
#
print "input:";
chomp($input=);
my $var=$input;
my @name=qw{com net org gov};
my $want=&find($var,@name);
sub find {
print "@_\n";
($what,@list)=@_;
foreach (0 ..$#list) {
if ($what eq $list[$_]) {
return $_;
}
}
"No Found";
}
print "your array is:@name\n$input\'s possion:$want\n";
阅读(1364) | 评论(0) | 转发(0) |