Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use v6;
- print "Input line: ";
- my $line = get;
- if ($line === Any) {
- say "got EOF..";
- say "Reopening STDIN..";
- $*IN.close;
- my $fh = open "/dev/tty", :r, chomp => $*IN.chomp, nl-in => $*IN.nl-in,
- encoding => $*IN.encoding;
- $*IN = $fh;
- my $line = get;
- say "Got line: {$line}";
- }
- else {
- say "Not EOF, got line: {$line}";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement