Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Welcome to the Monastery
 
PerlMonks  

Re: Line size in a text widget

by Daruma (Curate)
on Mar 09, 2004 at 23:43 UTC ( [id://335347]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Line size in a text widget

Greetings, witandhumor!

I'm having a hard time visualizing what you are trying to do here.

Is this to be a text box where the text wraps to the next line at 30 characters?

or

Is this to be a text box that limits the information to 30 characters?

Daruma

Replies are listed 'Best First'.
Re: Re: Line size in a text widget
by witandhumor (Pilgrim) on Mar 09, 2004 at 23:46 UTC
    I should have clarified...sorry about that. This is a text box where the text wraps to the next line at 30 characters.
      not tested, just an idea...
      use Text::Autoformat; my ($allTheText) = shift; ## all your text to format my (@lins); ## your resulting lines my ($widthTxt) = 30; ## your line width... { my ($formated)=autoformat($allTheText, { left=>5, right=>$widthTxt +, all=>1}) if ($allTheText); foreach (split(/\n+/,$formated)) { push(@lins,$_); ## array w/lines of max.30chrs.wth. } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://335347]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.