Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^8: How can I expand my substring?

by Anonymous Monk
on Jul 22, 2014 at 13:59 UTC ( [id://1094633]=note: print w/replies, xml ) Need Help??


in reply to Re^7: How can I expand my substring?
in thread How can I expand my substring?

Thanks again, is it possible to break your code down a bit?
Like in using more lines I mean, so I can then use and if clause in limiting the length $1 as you suggest...

Replies are listed 'Best First'.
Re^9: How can I expand my substring?
by Corion (Patriarch) on Jul 22, 2014 at 14:53 UTC

    Sorry, but I won't do your programming for you.

      I am very sorry, I did not mean at any point that you should write the code for me...I was just wondering if you would be kind enough to re-write your substitution statements in more lines instead of 1. Then I would be able to insert the if clause and restrain the expanding to +-200 that I want, that's all...

        To understand Corion's code you need to read and understand the regular expression documentation Corion pointed you to earlier in the thread. Regular expressions aren't amenable to "break your code down a bit" in the way you mean. They are a powerful language in their own right and learning how to use regular expressions is an important part of using Perl well. Read back through this thread and pay special attention to the bits you skimmed the first time through.

        Perl is the programming world's equivalent of English

        perlop, as I already linked to you, explains how the right hand side part of s///e works. I don't know how I could break down an if statement more than writing down the if statement within the right hand side of s///e. But as I'm sure you already have read that in the documentation that I already linked to, I don't know how to help you further.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found