tryingnottofailmytes has asked for the wisdom of the Perl Monks concerning the following question:
not sure how to make the module work and why I'm getting "Use of uninitialized value $annotation in print at parse.pl line 28, <GBFILE> line 1. Use of uninitialized value $dna in print at parse.pl line 28, <GBFILE> line 1. " errors.#!/usr/bin/perl -w use strict; #use beginperlforbioinfo; my $annotation = ''; my $dna = ''; my $record=''; my $filename = "record.gb"; my $save_input_separator = $/; unless (open(GBFILE, $filename)) { print "Cannot open Genbank file "; exit; } #use the input seperator //\n to read a entire file to scalar $/ = "//\n"; $record= <GBFILE>; #print $record; #always to remember to reset the file input seperator $/= $save_input_separator; #to seperate the annotation from sequence ($annotation, $dna) = ($record =~ /^(LOCUS.*ORIGIN\s*\n)(.*)\/\/\n/s); print "$annotation, $dna\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error Unitialized value and use
by kcott (Archbishop) on Dec 08, 2015 at 06:15 UTC | |
|
Re: Error Unitialized value and use
by AnomalousMonk (Archbishop) on Dec 08, 2015 at 06:05 UTC | |
|
Re: Error Unitialized value and use
by GrandFather (Saint) on Dec 08, 2015 at 07:14 UTC | |
by AnomalousMonk (Archbishop) on Dec 08, 2015 at 17:35 UTC |