Re: [Module::Build] stem config code
Status: Beta
Brought to you by:
kwilliams
|
From: Uri G. <ur...@st...> - 2004-01-04 17:46:57
|
>>>>> "RWS" == Randy W Sims <Ra...@Th...> writes:
RWS> On 1/4/2004 2:01 AM, Uri Guttman wrote:
>> sub edit_query {
>> my ( $query, $default ) = @_;
>> chomp $query;
>> my $last_line = (split /\n/, $query)[-1];
>> if ( length( $last_line ) + 2 * length( $default ) > 70 ) {
>> $query .= "\n\t";
>> }
>> return $query ;
>> }
RWS> A simple format_prompt() function similar to the above which also
RWS> wrapped lines on word boundaries at some configurable screen width
RWS> could make for some nicer prompts.
would that want to be standalone or use text::format? also some
queries/prompts might have formatted text (indented, columns, etc.)
which would be broken in a formatter. so i thought only dealing with the
last line and the default was a good idea. i use here docs so my prompt
text looks exactly as i want it to look (other than that last line).
uri
--
Uri Guttman ------ ur...@st... -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
|