";# Get input form STDIN, this is short for my $get = chomp (my $get = );# Quit when user pre。一个命令行交互脚本。" />

一个命令行交互脚本

按q键退出,否则显示用户输入。

#! /usr/local/bin/perl5use strict; use warnings; sub test { while (1) { # display the prompt print "sditest> "; # Get input form STDIN, this is short for my $get = chomp (my $get = <>); # Quit when user pressed 'q', otherwise print what ever input if ($get eq 'q') { # How to determine user pressed Esc here? exit; } else { print $get, "\n"; } } }test();

【一个命令行交互脚本】
==

    推荐阅读