Advertisement
cwchen

[Perl 6] redo demo.

Oct 5th, 2017
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.09 KB | None | 0 0
  1. loop {
  2.     my $x = prompt("Enter a number: ");
  3.     redo unless $x ~~ /\d+/;
  4.     last;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement