[EMAIL PROTECTED] (Peter Scott) writes:

> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] writes:
>>Before starting to write my script designed to make filename changing
>>easier I'd like to ask how to create an editable command line inside a
>>perl script?
> [snip]
>
> Term::ReadLine

Ah yes.  Any idea how to make perl insert a string (actually a file
name from an earlier process into that command line?

Just inserting a sting to test like this doesn't work.  The sting
isn't editable.

>From the perldoc example for Term::Readline

use Term::ReadLine;
my $term = new Term::ReadLine 'Simple Perl calc';
my $prompt = "Enter your arithmetic expression: <SOMETHING HERE>";
my $OUT = $term->OUT || \*STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
   my $res = eval($_);
   warn $@ if $@;
   print $OUT $res, "\n" unless $@;
   $term->addhistory($_) if /\S/;
}

How can I get an editable file name in there programatically?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to