Why use Perl at all?
ypcat passwd | awk -F: '{ print $1."@domain.local" }' > oneliner.out [download]
In reply to Re: add text to each line of a file by b10m in thread add text to each line of a file by stevenrh