Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: Regex: Example works, plugging it into code doesn't.

by EclecticScion (Novice)
on Jun 14, 2013 at 16:27 UTC ( #1038993=note: print w/replies, xml ) Need Help??

in reply to Re: Regex: Example works, plugging it into code doesn't.
in thread Regex: Example works, plugging it into code doesn't.

Thanks! I have removed the extra code that follows the problem code.

print (">>>$finalline<<<");

returns full sentences from the source files, like the one in the example above (in particular, the program succesfully outputs a new RTF file with all the lines intact). E.g.:

>>> 3.2 COMPLIANCE WITH LAWS AND REGULATIONS. While the Product is in its possession or under its, or its sub contractor's control, AKORN shall comply, or ensure that its subcontractors comply, with all applicable federal, state and local statutory and regulatory requirements regarding the manufacture, if applicable, packaging, handling transportation and storage of the Product. <<<

Replies are listed 'Best First'.
Re^3: Regex: Example works, plugging it into code doesn't.
by smls (Friar) on Jun 14, 2013 at 17:06 UTC
    I have removed the extra code

    But in doing so, you have also removed the part that actually caused the problem. If I hadn't seen your question before your edit, there wouldn't have been any way for me to identify the problem... :)

    Just blindly cutting away code that you think doesn't contribute to the problem, is not what "try to reduce your code further" means...
    What it means, is make a temporary copy of your script, and cut away code one chunk at a time, and each time test the remaining code to see if it still reproduces your bug (but is otherwise functional). Then when you've reached the minimal amount of code needed to reproduce the bug, remove file read's and module calls etc. as much as possible, and replace them with in-place definitions of dummy data. Test again, to see if it still reproduces the bug. If it does, that's what you should upload to Perl Monks.

    Just for future reference... :)

      That makes sense. Thanks!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2018-12-11 03:34 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (52 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!