#!/usr/bin/perl use strict; use warnings; my $line; while ( (print "Prompt: "), $line=, $line !~ /^\s*Q(uit)\s*$/i ) { $line =~ s/^\s*//; $line =~ s/\s*$//; print"xyzzy \"$line\" and nothing happens\n"; } print "Some version of QUIT, QuIt, quit entered\n"; __END__ C:\Projects_Perl\testing>perl simplecommandline.pl Prompt: 123 xyzzy "123" and nothing happens Prompt: abc xyzzy "abc" and nothing happens Prompt: 123 abc xyzzy "123 abc" and nothing happens Prompt: qui xyzzy "qui" and nothing happens Prompt: quit doing that! xyzzy "quit doing that!" and nothing happens Prompt: QUiT Some version of QUIT, QuIt, quit entered