develooper Front page | perl.beginners | Postings from February 2012

Editing line of text.

Thread Next
From:
Sean Murphy
Date:
February 7, 2012 23:37
Subject:
Editing line of text.
Message ID:
375B4FFE-94DB-4493-9C42-10B176EA418D@gmail.com
Hi All.

This should be a simple task. But for the life of me, I cannot work it out.
I have a chunk of text in an scaler. I want to edit this text. I look at Term::ReadLine and couldn't see a way of inserting the text into the edit area. There is addhistory  which adds to the history buffer. but this isn't want I want.

For example:

$text = "this is a test";
$text = function ($text); # permits full editing of line.
print "$text\n";

When script is executed. The text in $text is displayed. The cursor and delete commands work. So the line can be modified. 

so how can this be done? I haven't seen any modules that seem to permit this. Example code would be great.

This is for a program I am writing to handle my home budgets. I am extracting the text from a database using DBI.

Sean 
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About