-1

Hi I have a Perl script named feed_validator.pl. From this, I am calling a Perl module named fetch_sequence_vals.pm as follows:

my ($AIT_hash_ref,$SE_hash_ref,$SBC_hash_ref,$db_pack_val_tpb)=fetch_sequneceVals::seqVals();

fetch_sequence_vals.pm returns the reference of three hashes as shown below.

return(\%AIT_hash,\%SE_hash,\%SBC_hash,$db_pack_val_tpb);

Now, I am passing these three hashes as input for two Perl modules named SortFeedSeq and SeqComparator, as shown below.

my $sortfeedtrailer = SortFeedSeq::sortfeedseq(
    $region,$sortfileout,$SortedTrailerFile,\%AIT_hash,\%SE_hash,\%SBC_hash);   
my $compareseq= SeqComparator::comparator(
    $region,$SortedTrailerFile,$seq_err,$gap_err,\%AIT_hash,\%SE_hash,\%SBC_hash);

When I run feed_validator.pl, it's throwing a compilation error saying

Not enough arguments for SortFeedSeq::sortfeedseq

and

Not enough arguments for SeqComparator::comparator

I am stuck in this from few days. Kindly someone help me in solving the error. Thanks in advance.

ikegami
  • 367,544
  • 15
  • 269
  • 518
nithin
  • 23
  • 4
  • They are the subroutines inside SortFeedSeq and SeqComparator package respectively. – nithin Feb 08 '16 at 14:18
  • Not the problem you're asking about, but shouldn't `\%AIT_hash,\%SE_hash,\%SBC_hash` be `$AIT_hash_ref,$SE_hash_ref,$SBC_hash_ref`? Always use `use strict; use warnings qw( all );`! – ikegami Feb 08 '16 at 14:28
  • Hi I am a beginner in perl. What exactly a prototype mean. How to find it out? – nithin Feb 08 '16 at 14:28
  • 'sub sortfeedseq($$$$$$){ my $feed_type=$_[0]; my $FeedInputFile=$_[1]; my $SortedTrailerFile=$_[2]; my $AIT_hash_ref=$_[3]; my $SE_hash_ref=$_[4]; my $SBC_hash_ref=$_[5]; my code......}' – nithin Feb 08 '16 at 14:32
  • sub comparator($$$$$$$) {my $feed_type=$_[0]; my $InputSortedFile=$_[1]; my $Seqerrfile=$_[2]; warn info_H. "Seqerrfile is:$Seqerrfile \n"; my $Gaperrfile=$_[3]; warn info_H. "Gaperrfile is:$Seqerrfile \n"; my $AIT_hash_ref=$_[4]; my $SE_hash_ref=$_[5]; my $SBC_hash_ref=$_[6]; } – nithin Feb 08 '16 at 14:34
  • This is how I am reading the arguments in subroutines. – nithin Feb 08 '16 at 14:34
  • 1) That's not readable. Pieces of your question should be in your Question. 2) The code in your question combined with those definitions do not result in the error messages you got. – ikegami Feb 08 '16 at 14:36
  • it's saying the error in in line num 92 and 93. in line 92 and 93 I am not calling these subroutines. line 92 and 93 is below code my %SBC_hash=%$SBC_hash_ref; my $extractfooter = ExtractSort::extractfooter("$feedDir/$_",$fileout); – nithin Feb 08 '16 at 14:36

1 Answers1

1

sortfeedseq and comparator each have a prototype. A sub's prototype dictates the syntax of calls to it, and you are violating the syntax imposed by the prototypes of these subs. Specifically, you aren't passing the correct number of arguments to the subs.

As we aren't familiar with the subs in question, we can't tell you what the expect for arguments. You'll have to consult the documentation for these modules, or study the subs themselves.

ikegami
  • 367,544
  • 15
  • 269
  • 518