Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: substr question

by rowdog (Curate)
on Jun 18, 2010 at 21:20 UTC ( [id://845460]=note: print w/replies, xml ) Need Help??


in reply to Re: substr question
in thread substr question

if ( length($short) + length($parts[0]) <= $len ) { $short = join( ' ', $short, shift @parts ); }

The length is off by one because you add not only the part, but a new space as well. The easy fix is to delete the = from <= $len

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found