Quick actions

cmd+k|ctrl+k

Navigation

Languages

Perl 6: keypress to exit loop

Snippet info

Language

Raku

Visibility

public

Author

faac99595225e41a47832e135e116ab96da77576

Created

2017-09-14T01:57:25Z

Updated

2017-09-14T01:59:23Z

#!/usr/bin/env perl6

use v6;

loop {                                                                         
    given prompt('') {                                                                                                                         
        when 'q'|'quit' {                                                                                                                      
            last;
        }                                                                                                                                      
    }                                                                                                                                          
}
INFO