Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Do you know where your variables are?
 
PerlMonks  

Re^3: How to split a string based on length or word boundary

by BrowserUk (Pope)
on Dec 21, 2012 at 03:27 UTC ( #1009843=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to split a string based on length or word boundary
in thread How to split a string based on length or word boundary

As Athanasius pointed out above, you need to change that to:

print "| $_ |\n" for map substr( $_ . ' 'x$menuWidth, 0, $menuWidth ), + $text =~ m[(.{1,$menuWidth})(?:\s+|$)]g; #..................................................................... +.............................^^^^^^^^^

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^3: How to split a string based on length or word boundary
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-04-20 02:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls