{ local $/ = ';'; # input record separator - this is what chomp eats local $\ = "\n"; open(FILE, $adfile) || die "Can't open $adfile", $!; open(NEWFILE, "> $adfile.new") || die "Can't open new $adfile", $!; while () { chomp; print NEWFILE; } close(NEWFILE>; close(FILE); }