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

Re^3: Pearls (not really) of Perl programming

by ihb (Deacon)
on Nov 26, 2004 at 02:14 UTC ( #410492=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Pearls (not really) of Perl programming
in thread Pearls (not really) of Perl programming

More regex solutions: (don't forget the s modifier)

($default_title) = $default_title =~ /(.{0,50})/s; $default_title =~ s/(?<=.{50}).*//s;
I'd also want to add
substr($default_title, 50, length($default_title), '');
and second you and the original isn't that bad.

ihb

See perltoc if you don't know which perldoc to read!
Read argumentation in its context!


Comment on Re^3: Pearls (not really) of Perl programming
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2015-07-31 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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









    Results (274 votes), past polls