dwijew has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm new to perl and have had some problems trying to create a module. can someone please tell me how i can create a module and use the functions in a .pl file? or redirect me to a site which has an online tutorial for me to follow in order to understand how to do it.
below is my module so far
package FSClient; #file: MySequence.pm use strict; my $EcoRI = 'ggatcc'; use base 'Exporter'; my @EXPORT = qw(reversec seqlen); my @EXPORT_OK = qw($EcoRI) sub reversec { my $sequence = shift; $sequence = reverse $sequence; $sequence =~ tr/gatcGATC/ctagCTAG/; return $sequence; } sub seqlen { my $sequence = shift; $sequence =~ s/[^gatcnGATCN]//g; return length $sequence; } 1;
i have got a lot of compile errors in the .pl file which i use to call this module.
thanks
Wijew
20050520 Edit by Corion: Changed title from 'Modules'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to create Modules
by gopalr (Priest) on May 17, 2005 at 05:20 UTC | |
Re: how to create Modules
by tphyahoo (Vicar) on May 17, 2005 at 09:00 UTC | |
Re: how to create Modules
by Zaxo (Archbishop) on May 17, 2005 at 05:15 UTC | |
Re: how to create Modules
by polettix (Vicar) on May 17, 2005 at 09:15 UTC | |
Re: how to create Modules
by jbrugger (Parson) on May 17, 2005 at 05:25 UTC |