# Had to duplicate the prompt, , and chomp. # Duplication is bad! # Use the DRY principle: [D]on't [R]epeat [Y]ourself! my $word; print 'Please enter a word: '; chomp($word = ); while ( $word !~ /^\s*$/ ) { print "You entered '$word'\n"; print 'Please enter a word: '; chomp($word = ); }