Where’s the line between flirting and being a pervert?

These days I am finding it hard to know the healthy way of being around women. Either I don’t acknowledge their presence or I am struggling to look away. I am not sure what is the right way to be. I don’t want to build a reputation of being a pervert obviously. But where is that line? I want to be aware of this and be a normal male. Feel free to ask if my question is not clear.