use strict; use warnings; my $f="Joe Bloggs, 1615 Thislane Street, MyTown, NZ, 1851\n"; my $in=" This is a new longer address"; print $f; $f=~s/,.*/,$in/s; print $f;