|
Module
|
|
01-02-2012, 05:03 PM
Post: #1
|
|||
|
|||
|
Module
Hi Guys,
I can't use 'revcom' module of page 107. I get the msg: "Use of uninitialized value in concatenation (.) or string at test.pl line 12. ". If I put only 'print $revcom_dna' I get the msg:"Use of uninitialized value in print at test.pl line 12. ". So what is wrong? Thank you in advance. |
|||
|
01-03-2012, 08:35 PM
(This post was last modified: 01-04-2012 09:09 AM by Daz.)
Post: #2
|
|||
|
|||
RE: Module
(01-02-2012 05:03 PM)Joporci Wrote: Hi Guys, Hi, Would you be able to post the code you're using? I've had a look at the code in the book and I can't see anything wrong... Here's my test script (i've put the revcom subroutine in the main script and removed the comments but this would not have any effect on the outcome): Code: #! /usr/bin/env perlThanks, Daz |
|||
|
01-03-2012, 11:06 PM
(This post was last modified: 01-04-2012 08:37 AM by Daz.)
Post: #3
|
|||
|
|||
RE: Module
(01-03-2012 08:35 PM)Daz Wrote: Hi, Hello, Yes it works when they are in the same script. I tried to separate the subroutine of the main script. So here is 'MySubs.pm' module: Code: #!/usr/bin/perlThe script to run and reverse the DNA sequence is: Code: #!/usr/bin/perlBoth are in the same directory. I tried remove the '1;' and the shebang from MySubs.pm but it didn't work (maybe it is a bit obvious). Thank you Joporci |
|||
|
01-04-2012, 08:51 AM
(This post was last modified: 01-04-2012 08:52 AM by Daz.)
Post: #4
|
|||
|
|||
|
RE: Module
Hi,
Ok, I found a few of bugs in your MySubs.pm that were or were going to cause issues, first here's the corrected code: Code: sub revcom {The problems were:
I hope this helps. ![]() p.s. Not nagging, but I do hope that code was indented before you posted it into the forum - a simple thing like indenting code can sometimes help to find or prevent small (and often infuriating) bugs... |
|||
|
01-04-2012, 09:31 AM
Post: #5
|
|||
|
|||
|
RE: Module
Hi Daz,
Yes it was my mistake. What a shame. Now it works fine. Next time I will pay more attention before posting 'nonsense' questions in the forum. Thank you, Joporci |
|||
|
01-04-2012, 09:35 AM
Post: #6
|
|||
|
|||
RE: Module
(01-04-2012 09:31 AM)Joporci Wrote: Now it works fine. Next time I will pay more attention before posting 'nonsense' questions in the forum. No need to worry, we all made these mistakes when starting out with programming. And don't worry about posting simple questions on here, this is what we intended the site for.
|
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)

Search
Member List
Help




