Chip Atkinson writes: > $slash = $/; > > $/ = undef; > > $file = <>; > > $/ = $slash; > > $file =~s/<(\w+)>/$substfields{$1}/g; > > print $file; Save yourself some typing (and bugs :) by: { local($/); $file = <>; } $file =~s/<(\w+)>/$substfields{$1}/g; print $file; Rob