in reply to Re: crlf to \n
in thread crlf to \n

or just:
perl -pi -e 'tr[\r][]d' environments.txt

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});