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

Re: Truncating Last Sentence

by sacked (Hermit)
on May 14, 2004 at 19:36 UTC ( [id://353471]=note: print w/replies, xml ) Need Help??


in reply to Truncating Last Sentence

You'll want to use the substitution operator s///, not the transliteration operator tr///. See perlop for details. I would suggest something like the following:
if( length($lRow) > 1000 ) { $lRow = substr($lRow, 0, 1000); $lRow =~ s/(?<=\.)[^.]*$//; }

--sacked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found