Hi all! I need to check if file indicated in the command line contains any symbols other than a, c, t or g. Here is what I wrote:
#!/usr/bin/perl -w use strict; my $DNA; chomp ( $DNA = $ARGV[0] ); open ( INPUT_FILE, "$DNA" ) or die; if ( <INPUT_FILE> =~ m/[^actgACTG]/ ) { print "File contains something besides actg sequence.\n"; } else { print "good!\n"; }
The problem is that this code matches non actg symbols in files that contain only actg letters. Help please!
In reply to =~ matches non-existent symbols by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |