Readline interface

require('Term::ReadLine')

var term = %O<Term::ReadLine>.new('Example')

term.addhistory('foo')
term.addhistory('bar')

loop {
    var cmd = term.readline("Prompt: ") \\ break

    if (cmd ~~ %w[q quit]) {
        break
    }

    say "You inserted <<#{cmd}>>"
}