As posted, the code is a cut-and-paste of a command line session. It is intended to show source code and invocation switches, pragmata, etc., command line input (to @ARGV), and command line output. The source code is everything between the pair of " (double-quotes). (Note that these are the only double-quotes in the posted code section.)
I don't know what you are doing to run the code, but try this:
In fact, here's the edited section of code that should be all ready to go, just use the [download] link and save to a file of your choice:
die 'Please enter exactly two sequences' unless @ARGV == 2; ;; my ($seq1, $seq2) = map uc, @ARGV; die 'Please enter only ATCG sequences' if grep /[^ATCG]/, $seq1, $seq2 +; ;; die 'Sequence lengths differ' if length $seq1 != length $seq2; ;; (my $comp = $seq2) =~ tr/ATCG/TAGC/; my $mask = $seq1 ^ reverse $comp; ;; if ($mask !~ m{ [^\000] }xms) { print 'The sequences are reverse-complementary'; exit; } ;; $mask =~ tr{\000-\377}{_^}; print 'Sequences are non-reverse-complementary at these locations:'; print qq{@ARGV}; print qq{$mask }, ''.reverse $mask;
Update: I just downloaded and saved the code block immediately above in this reply and went through the steps listed above (except it doesn't have to be edited), and it works. Be sure not to use the -e switch when invoking a file; it is used for command-line source code statements. HTH.
In reply to Re^3: Reverse Complement
by AnomalousMonk
in thread Reverse Complement
by stamp1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |