Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: substr question

by rowdog (Curate)
on Jun 18, 2010 at 21:20 UTC ( #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

Comment on Re^2: substr question
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-05 18:54 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (67 votes), past polls