Vasek has asked for the wisdom of the Perl Monks concerning the following question:
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"; [download]
(BTW, what you refer to as STDIN is usually called the terminal/console's prompt, strictly speaking...)