Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Just another Perl shrine
 
PerlMonks  

Re: using redo in an if/else statement

by thatguy (Parson)
on Jan 14, 2003 at 17:36 UTC ( #226903=note: print w/ replies, xml ) Need Help??


in reply to using redo in an if/else statement

Maybe you cannot do it with redo but you can with while

#!/usr/bin/perl use strict; print "What is the Part Number that you would like to look up?\n"; my $PartNumber = <STDIN>; chomp($PartNumber); while (!$PartNumber){ ## while $PartNumber is empty keep asking print "PartNumber? "; $PartNumber = <STDIN>; chomp($PartNumber); } print "What is the Revision level for $PartNumber?\n"; my $Revision = <STDIN>; chomp($Revision); while (!$Revision){ ## while $Revision is empty keep asking print "Revision? "; $Revision = <STDIN>; chomp($Revision); } print "PartNumber: $PartNumber\n"; print "Revision: $Revision\n";

-phill


Comment on Re: using redo in an if/else statement
Download Code
Re: Re: using redo in an if/else statement
by Bismark (Scribe) on Jan 14, 2003 at 17:51 UTC
    Thank you for the hints to the right direction! As you can see, I am a bit of a novice with this great language. With help like I have received at the Monastery I will soon be on my way.
    Thanks again!

    Kerry

    credo quia absurdum

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://226903]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-04-16 23:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (436 votes), past polls