sub get_input { { print @_; my $input = ; chomp $input; redo unless $input; $input; } } my $PartNumber = get_input 'What is the Part Number that you would like to look up?', $/; my $Revision = get_input 'What is the Revision level for ', $PartNumber, '?', $/; # go on to verify that those make sense, redo if they don't