in reply to About a piece of code

m/^\n/ is a regular expression that tries to match a newline (\n) at the beggining of the line (^). If there is such a match on the current value of $_, the code jumps back to the condition on the while loop, in this case reads one more line from the file.

So, this code is skipping blank lines on the file.

update as Marshall correctly points, the code skips lines that start with the \n disregarding whatever comes next.