in reply to <STDIN> "anticipate" input?

Here is a start on a Tk solution. Entries also have a "validatecommand", with which you can pretest the user's text to be valid. You will have to search groups.google.com for "Perl Tk Entry validate" for examples... it can get complex. A Tk::Text widget could also be used, but an Entry widget is simpler for this problem (i.e. no multiline text )
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); $mw->fontCreate('medium', -family=>'arial', -weight=>'bold', -size=>int(-14*14/10)); my $frame = $mw->Frame()->pack(); my $bframe = $mw->Frame()->pack(); my $estring = 'C://foo/bar/'; my $lstring = 'Please enter file'; my $label = $frame->Label( -textvariable => \$lstring, -bg => 'white', -width => 25, -justify =>'right', -anchor => 'e', -font => 'medium', )->pack(-side=>'left',-padx=>5); my $entry = $frame->Entry( -textvariable => \$estring, -bg => 'white', -width => 25, -font => 'medium', )->pack(-side=>'left',-padx=>5); $entry->focus; $entry->icursor('end'); $entry->bind('<Return>', \&get_file); $bframe->Button( -text => 'Quit', -command => sub { exit } )->pack(-side=>'left',-padx=>5); $bframe->Button( -text => 'Change', -command => sub { $lstring = 'Enter another'; $estring = 'D://foo/fi/fum/'; $entry->focus; $entry->icursor('end'); } )->pack(-side=>'left',-padx=>5); MainLoop; sub get_file{ my ($widget) = @_; my $entered = $widget->get(); print "file = $entered\n"; }

I'm not really a human, but I play one on earth Remember How Lucky You Are