Convert a program to a palindromic program A palindrome is a string that is the same forwards and backwards, such as "racecar".

Write a program in some language L, that takes any program P1 in language L as input, and outputs a palindromic program P2 in language L that does the same thing as P1.

You do not need to worry about handling input programs with syntax errors.

This is code golf, so the solution with the fewest number of bytes wins.
Perl, 55 54 bytes



undef$/;$a=&lt;&gt;."\n__END__\n";print$a,scalar reverse$a;


Reads program source from stdin and writes to stdout.

Result of running on itself:

undef$/;$a=&lt;&gt;."\n__END__\n";print$a,scalar reverse$a;

__END__

__DNE__

;a$esrever ralacs,a$tnirp;"n\__DNE__n\".&gt;&lt;=a$;/$fednu