Re: [Module::Build] stem config code
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <Ra...@Th...> - 2004-01-04 22:22:54
|
On 1/4/2004 12:46 PM, Uri Guttman wrote:
>>>>>>"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).
Actually, you're right--Here docs eliminate the need for word wrapping.
This is what happens when I think before I speak <:-I
Randy.
|