s#
#
#g;  # this is OK
s#
##g; # this creates the problems