#!/usr/bin/perl -w # use strict; my $value; while ( not defined $value or $value eq 'R' ) { chomp($value = ) if ( $value eq 'E') { exit; } }