supriyoch_2008 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perlmonks,
I have made a perl module DNAappend.pm with a single subroutine DNAappend in order to learn the steps of making a module. Then I have written a small script i.e. joindna.pl. When I have tried to run the perl script, the command window does not show the expected result. I can't make out where I have made the mistake in the script. I know it could be a very silly question to the perl monks but I am at my wit's end to find the solution. I welcome any constructive suggestions from the perlmonks about the script and perl module.
Here goes the script joindna.pl
#!/usr/bin/perl use warnings; use strict; use DNAappend; my $a='ATGC'; my $b='TTTT'; print"\n\n"; print DNAappend($a,$b); print"\n\n"; exit;
I have written the DNAappend.pm as follows:
package DNAappend; use strict; use warnings; sub DNAappend { my ($head,$tail)=@_; return ($head.$tail) } 1;
The command window has shown the result:
C:\Users\x\Desktop>joindna.pl Undefined subroutine &main::Dnaappend called at C:\Users\x\Desktop\joi +ndna.pl line 8. C:\Users\x\Desktop>
The correct result should look like:
ATGCTTTT
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I define the subroutine to get the result of the appended string i.e. ATGCTTTT?
by toolic (Bishop) on Sep 25, 2012 at 16:22 UTC | |
by supriyoch_2008 (Monk) on Sep 25, 2012 at 18:24 UTC | |
|
Re: How can I define the subroutine to get the result of the appended string i.e. ATGCTTTT?
by Marshall (Canon) on Sep 25, 2012 at 16:31 UTC | |
by supriyoch_2008 (Monk) on Sep 25, 2012 at 18:27 UTC | |
by Marshall (Canon) on Sep 25, 2012 at 19:03 UTC | |
|
Re: How can I define the subroutine to get the result of the appended string i.e. ATGCTTTT?
by Anonymous Monk on Sep 25, 2012 at 21:09 UTC |