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

Re: do until loop breaks before meeting the condition

by BillKSmith (Deacon)
on Jun 08, 2014 at 19:53 UTC ( #1089206=note: print w/ replies, xml ) Need Help??


in reply to do until loop breaks before meeting the condition

Avoid the issue. Use a prompt module.

use strict; use warnings; use IO::Prompt::Hooked; my %opt = ( message => "Enter text (1-255 characters) to send to clients: ", validate => qr/^.{1,255}$/, error => "You have exceeded the limit of 1-255 characters - Try + again\n", escape => qr/^END$/i, ); while ( my $result = prompt(%opt) ) { print ">>$result<<\n" }
Bill


Comment on Re: do until loop breaks before meeting the condition
Download Code
Replies are listed 'Best First'.
Re^2: do until loop breaks before meeting the condition
by thanos1983 (Hermit) on Jun 12, 2014 at 00:35 UTC

    To: BillKSmith,

    Nice, I had no clue about this process. It might also come in handy to other scripts. Thanks for sharing.

    Seeking for Perl wisdom...on the process...not there...yet!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2015-07-30 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls