Most of the time the user will leave the value unchanged or make minor spelling or capitalisation changes. To make it easier for them I’d like to push the existing value into the keyboard buffer so that it appears on the line as if they had just typed it. That way they can quickly amend it or just press return and it will come in through STDIN as if they had just typed it. Any help will be gratefully appreciated.my $record = { name => 'joe bloogs', age => 34, hobby => 'chess', }; for my $property ( keys %$record ) { print STDOUT "$property: "; chomp( $response = <STDIN> ); $record->{$property} = $response; }
In reply to adding default text to STDIN by bangers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |