G
Guest
Hello,
I'm experiencing problems with getch() from Curses. If I want to proces
standard input first with <>, takes all cpu time for, as it seems,
nothing except looping. Here is an example:
#!/usr/bin/perl
use Curses;
1 while <>;
initscr();
while (1) {
if (getch() eq 'q') {
endwin();
exit;
}
}
If you run it like "script.pl < somefile", pressing 'q' doesn't do
anything, whereas if you run it like "script.pl somefile", it works as
expected.
Ideas? Thanks,
andrej
I'm experiencing problems with getch() from Curses. If I want to proces
standard input first with <>, takes all cpu time for, as it seems,
nothing except looping. Here is an example:
#!/usr/bin/perl
use Curses;
1 while <>;
initscr();
while (1) {
if (getch() eq 'q') {
endwin();
exit;
}
}
If you run it like "script.pl < somefile", pressing 'q' doesn't do
anything, whereas if you run it like "script.pl somefile", it works as
expected.
Ideas? Thanks,
andrej