Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Isolating DNA cont.

by toolic (Bishop)
on Dec 20, 2018 at 20:41 UTC ( #1227548=note: print w/replies, xml ) Need Help??


in reply to Isolating DNA cont.

You are missing a closing (right) curly for the while loop, as the asymmetric indentation suggests. Here's the perltidy version (Tip #10 from the Basic debugging checklist):
#!/usr/bin/perl -w use strict; use diagnostics; my $file = "$ARGV[0]"; open( DAT, $file ) || die("Can not open file!"); while (<DAT>) { my $seq = $_; if ( $seq =~ m/^[ATCG]+$/ ) { my $DNA = ''; $DNA = $seq; my $revcom = reverse($DNA); $revcom =~ tr/ACGTacgt/TGCAtgca/; print $revcom; } }

I also got rid of the trailing semicolon after your right curly.

Replies are listed 'Best First'.
Re^2: Isolating DNA cont.
by undergradguy (Novice) on Dec 20, 2018 at 21:03 UTC
    Ah thank you very much.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1227548]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2020-10-20 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (209 votes). Check out past polls.

    Notices?