in reply to using redo in an if/else statement
Yes, redo is good for that, but the if{}else{} control is less good. How about factoring the message out of an input sub?
sub get_input { { print @_; my $input = <STDIN>; 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
After Compline,
Zaxo
|
|---|