Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: using redo in an if/else statement

by thatguy (Parson)
on Jan 14, 2003 at 17:36 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://226903]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-19 02:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found