#----------------------------- # the signal handler sub ding { $SIG{INT} = \&ding; warn "\aEnter your name!\n"; } # prompt for name, overriding SIGINT sub get_name { local $SIG{INT} = \&ding; my $name; print "Kindly Stranger, please enter your name: "; chomp ( $name = <> ); return $name; } #-----------------------------
by: 发表于:2017-09-18 17:50:36 顶(0) | 踩(0) 回复
??
回复评论