Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: (jeffa) Re: Wordwrap text

by bastard (Hermit)
on Jul 27, 2001 at 02:13 UTC ( #100170=note: print w/replies, xml ) Need Help??


in reply to Re: (jeffa) Re: Wordwrap text
in thread Wordwrap text

This should also work:
#example 1 $content =~ s/(.{1,$width}) /$1<BR>/g; print $content;
or
#example 2 $content =~ s/(.{1,$width}) |([^ ]{$width})/$1$2<BR>/g; print $content;
The $width represents the largest number of characters each line should have.
The first example does not break single words longer than the variable $width specifies. The second will.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://100170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-07-04 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?