#!/usr/bin/perl -w
@students = qw/Doreen Oskar Elin Sangeet Malin/;
&next_student;
&next_student;
sub next_student {
$i++;
print "the next student is $students[$i]\n";
}
the next student is Oskar
the next student is Elin
#!/usr/bin/perl -w
@students = qw/Doreen Oskar Elin Sangeet Malin/;
&next_student;
&next_student;
sub next_student {
$i++;
print "the next student is $students[$i]\n";
}
the next student is Oskar
the next student is Elin
转载于:https://www.cnblogs.com/liuhui0622/p/5024476.html