`
wind9984
  • 浏览: 46758 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Perl 的last ,next ,redo 程序控制操作

    博客分类:
  • Perl
阅读更多
#!/usr/bin/perl

foreach(1..10){
	print "Iteration number $_.\n\n";
	print "Please choose: last, next, redo, or none of the above?";
	chomp(my $choice = <STDIN>);
	print "\n";
	last if $choice =~ /last/i;
	next if $choice =~ /next/i;
	redo if $choice =~ /redo/i;
	print "That was't any of the choices. onward!\n\n";
}
print "That's all, folks\n"
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics