#!/usr/bin/perl -w
# Calculating the reverse complement of a strand of DNA

# read lines from file or STDIN
while ( $DNA = <> ) {

	# remove line ending
	chomp( $DNA );

	# Make a new (reverse) copy of the DNA
	$revcom = reverse $DNA;

	# Translate A->T, C->G, G->C, T->A
	$revcom =~ tr/ACGT/TGCA/;

	# Print the reverse complement DNA onto the screen
	print "$revcom\n";
}
