#!/usr/bin/perl use strict; use warnings; for () { $_ =~ s/=\n//; print; } __DATA__ test1;test2;test3;test4;test= 5;test6 1;2;3;4;5= ;6