$/ = ""; /=(\N+)\n[^=]+=\1\n/ or print while <>; #### perl -00ne'/=(\N+)\n[^=]+=\1\n/ or print' data-file