in reply to the greedy diamond, or leggo my STDIN

Hey I dont know the complexity or what you wish to do further. But here is a very simple suggestion:

use the sleep <int> function instead.

#!/usr/bin/perl my @msg = (<>); chomp(@msg); print join("\n",@msg),"\n"; print STDOUT "What do you want to do with this message?\n";$|++; sleep (5); my $response = <STDIN>; print $response;$|++;

Replies are listed 'Best First'.
Re^2: the greedy diamond, or leggo my STDIN
by dsheroh (Monsignor) on Jul 05, 2007 at 16:06 UTC
    All that does is cause the program to wait 5 seconds before exiting. It still doesn't receive any input from the keyboard (because, as others have pointed out above, STDIN isn't connected to the keyboard).

    And <code> tags are your friends.