#!/usr/bin/perl while(1) { if (eof(STDIN)) { print "EOI\n"; exit; } $_ = ; if (/^q/i) { print "QUIT\n"; exit; } print; }