孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

#!/usr/bin/perl -w
use 5.010;
my $dog='Spot';

given ($dog) {
    when (/o/) { say 'The name has an "o"'; continue }
    when (/t/) { say 'The name has an "t"'; continue }
    when (/d/) { say 'The name has an "d"'; continue }
}

posted on 2012-09-28 22:20  孤独的猫  阅读(269)  评论(0编辑  收藏  举报