In case you have Term::ReadLine::Gnu installed, you can do:
#!/usr/bin/perl use Term::ReadLine; my $term = new Term::ReadLine 'Demo'; my $prompt = '$\\HEAD\\'; my $dir = "foo/bar"; # user-editable default input my $user_input = $term->readline($prompt, $dir); print "user_input: $user_input\n";
(BTW, what you refer to as STDIN is usually called the terminal/console's prompt, strictly speaking...)
In reply to Re: Writing to STDIN
by almut
in thread Writing to STDIN
by Vasek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |