in reply to [Solved]Need to extract a particular block of lines between two patterns

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^2: [Solved]Need to extract a particular block of lines between two patterns
by Laurent_R (Canon) on Nov 09, 2017 at 09:00 UTC
    Hi sundialsvc4,

    chengchl's question was essentially: how can I use the flip flop operator and pick up only the second START .. END block of text.

    Even assuming your suggested code were correct Perl code (which it isn't) and would run, it still wouldn't do what the OP was asking for, but only mimic the flip flop operator.

    The flip flop operator has a somewhat surprising edge-case behavior (when exactly is it reset) which might justify writing explicit code, but your code (if it worked) would not do what was asked for.

    Update: s/would do what/would not do what/;. Thanks to hippo for noticing the missing negation at the end of my last sentence above. Now fixed.

Re^2: [Solved]Need to extract a particular block of lines between two patterns
by eyepopslikeamosquito (Archbishop) on Nov 09, 2017 at 21:43 UTC

        Why do you or so much energy into replying? Everything was already said, just link to an overview post summing it up.

        I don't share your confidence that "everything was already said". Though I could link to a node that summarises the observed behaviour patterns, that does not solve the mystery of the "why" behind the behaviour. Note that your summary link does not address the "why" behind the behaviour.

        Please note that -- unlike many of his detractors -- sundial does not (deliberately) hide behind a cloak of anonymity, so simplistic "psychology of internet troll" arguments do not apply. If anyone with psychology qualifications can provide some insight, I'm all ears.

Re^2: [Solved]Need to extract a particular block of lines between two patterns
by Anonymous Monk on Nov 09, 2017 at 02:19 UTC
    Thank you for your javascript solution to a perl question. When I do run it in perl I get:
    Bareword found where operator expected near "// state" elseif should be elsif syntax error near "// state " Bareword "false" not allowed while "strict subs" in use Bareword "false" not allowed while "strict subs" in use Bareword "false" not allowed while "strict subs" in use Bareword "true" not allowed while "strict subs" in use
Re^2: [Solved]Need to extract a particular block of lines between two patterns
by Anonymous Monk on Nov 09, 2017 at 09:25 UTC

    And, I would certainly insist that anyone on my team must create a series of automatic (Test::Most) tests to demonstrate that the logic actually does work
    I know someone in your team who doesn't test their code

Re^2: [Solved]Need to extract a particular block of lines between two patterns
by Anonymous Monk on Nov 09, 2017 at 10:38 UTC
    Code that does not even compile, trash words, nothing of value, as usual. The ravings of a sad, mad old man.

      The ravings of a sad, mad old man.

      Be nice. Your time is gonna come.


      The way forward always starts with a minimal test.

        Be nice. Your time is gonna come.

        Why are you defending spam ? Just cause the guy spammed you in real life? We dont need spam here

      Spam is spam
Re^2: [Solved]Need to extract a particular block of lines between two patterns
by Anonymous Monk on Nov 09, 2017 at 10:23 UTC

    If this code works for you ... NOT PERL

    Go away

    Mike Robinson unqualified to give perl advice