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

Re^2: Bioinformatics- Use of uninitialized value

by xyzzy (Pilgrim)
on Jul 22, 2014 at 03:26 UTC ( [id://1094577]=note: print w/replies, xml ) Need Help??


in reply to Re: Bioinformatics- Use of uninitialized value
in thread Bioinformatics- Use of uninitialized value

This is in the original script as well, but since this version is prettier to look at, I'll comment here.

sub parseFile { my ($fIn) = @_; # a filehandle my $fastaData; ... #yada yada yada while (<$fIn>) { # $/ has not been undefined, $fIn is read line by + line $fastaData = $_; $fastaData =~ s/\n//gms; #/gms are all useless because: #g - each time $fastaData will have e +xactly one \n (at the end) #m - regex doesn't use ^ or $, and it +'s always a single line anyways #s - regex doesn't use . and it's alw +ays a single line anyways # effectively performs the same function as # chomp($fastaData); # or even # chomp($fastaData = $_); ... } ... }

Has nothing to do with the error but if we're on the subject of cleaning up the code, this is something that made me do a double-take.

On a less related note, GMS is also the name of a Dutch trance duo, whose three-hour live performance at a festival I attended was a life-changing experience, which is why that particular combination of letters always brings back the good vibes :^)


$,=qq.\n.;print q.\/\/____\/.,q./\ \ / / \\.,q.    /_/__.,q..
Happy, sober, smart: pick two.

Replies are listed 'Best First'.
Re^3: Bioinformatics- Use of uninitialized value
by GrandFather (Saint) on Jul 22, 2014 at 05:11 UTC

    I was getting tired by the time I got to refactoring that code and didn't actually look at it critically at all :(. Good catch. There are plenty more I sure!

    Perl is the programming world's equivalent of English

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-18 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found