Everything is karmic; there will be a consequence for every action. One must carefully weigh the options in meditation, to be guided to the action that will result in the best consequence given their circumstance.
It is very easy for us to get caught in "black or white" thinking, the battle of the opposites. We often believe the choices are only dual, such as (in your example) resort to prostitution or die of starvation. In reality, there are an infinite variety of possible actions, although we are often constricted in our thinking by our sleeping consciousness. When we awaken the consciousness in meditation and free it from the mind, new, creative possibilities will come to us. We will see more "shades or gray" between the two extreme options we previously believed we were faced with.
"If thou canst not make thine own self what thou desireth, how shalt thou be able to fashion another to thine own liking. We are ready to see others made perfect, and yet we do not amend our own shortcomings."
—Thomas à Kempis