#!/usr/bin/perl -w use strict; while ( (print "Enter Date: "), (my $date =) !~ /^\s*q(uit)?\s*$/i ) { next if $date =~ /^\s*$/; # reprompt on blank line chomp($date); if ($date =~ m|[^\d/]|) { print "Valid date has only digits and /!\n"; next; } #....more valdiation here .... #then actually do something before reprompting } #### my $start_date; my $end_date; while (print "Enter start date: ",!start_date_ok()); while (print "Enter end date: ", !end_date_ok ());