in reply to Issue with unless statement with two conditions acting on two lines

One problem is that $previous_line is always the 1st line of the file. You need to update it in the loop.
  • Comment on Re: Issue with unless statement with two conditions acting on two lines

Replies are listed 'Best First'.
Re^2: Issue with unless statement with two conditions acting on two lines
by rjc33 (Sexton) on Jan 08, 2016 at 15:55 UTC
    Wow, that's embarrassing! Thanks a lot, works just fine now - been a long day staring at a screen, can't believe I left that off and didn't realise. Cheers!
      print all lines to an output file
      But not the first one ?
      poj
        Thanks that's very important to highlight, re-adding the first line is the next thing I do in my code. I realise it's a very roundabout way of doing things, but at this stage in my learning I'm just trying to use whatever works which I'm comfortable with.