in reply to how to print only 47 and another number will rejected and when user give 47 that number only print ?

use IO::Prompt::Hooked qw(prompt); my $input = prompt( message => 'Please enter 47:', validate => qr/^47$/, ); print "You entered: $input\n";

Sample run:

Please enter 47: a Please enter 47: b Please enter 47: 42 Please enter 47: 47 You entered: 47

I feel it coming.... "But I can't use modules.":


Dave

  • Comment on Re: how to print only 47 and another number will rejected and when user give 47 that number only print ?
  • Select or Download Code