Whoever, having entered a building under circumstances which constitute burglary in any degree, commits any offense therein, shall be punished therefor as well as for the burglary, and may be prosecuted for each offense separately, or in the same action.