in reply to Is there a module for handling interactive user inputs?

How about something like the following?
use strict; use warnings; my $word = getInp('Enter a word : ', qr/^[a-z]+$/i); my $anything = getInp('Enter anything : '); sub getInp { print $_[0]; do { $_ = <STDIN>; chomp; } while ($_[1] && $_ !~ $_[1]); return $_; }
You just pass it your query and a regex and let it worry about doing the validation.