$ARGV[0] not $ARG[0]

You have defined $sbjct_scr, yet are attempting to use $sbjct_srs

You have defined %query_counts, yet are attempting to use %query_conunts

You are attempting to use the while() command, yet are calling it wile...

Typos and code don't mix. Ever.

Learn to proof read your e-mails as well, it will make you a better coder.
Ever noticed how few people that post solutions here have typos in their
e-mails? I don't think it's coincidence.

John

-----Original Message-----
From: webmaster [mailto:[EMAIL PROTECTED]]
Sent: 21 August 2001 14:48
To: perl
Subject: inquiry


what does
Global symbol "@ARG" requires explicit package name at testbio1.pl line 4.
Global symbol "$sbjct_scr" requires explicit package name at testbio1.pl 
line 29
.
Global symbol "%query_conunts" requires explicit package name at 
testbio1.pl lin
e 46.
Global symbol "$sbjct_srs" requires explicit package name at testbio1.pl 
line 48
mean?
and why on this lines I am getting a comp error...
{
  while ($query_src=~ /$pattern/g)
  {
    $query_conunts{$pattern}++;
  }
  wile ($sbjct_srs=~ /$pattern/g)
  {
    $sbjct_counts{ $pattern }++;
  }
}
 the whole wource code is here:

#!/usr/bin/perl
use strict;
my $REPORT_FILE="report.txt";
my $blast_file=$ARG[0]||'blast.dat';
unless (-e $blast_file)
{
  die "$0: error:missing file: $blast_file";
}
#slurp all the seqs in to the scalar
my ($query_src,$sbjct_src);

#open the blast data file and end prg (DIE) if we can't find it open(IN,
#$blast_file) or die
open (IN, $blast_file) or die "$0: ERROR: $blast_file: $!";

#go trought the blast file line by line, concat all the query and sbj seqs
while (my $line=<IN>)
{
  chomp $line;
  print "processing line $. \n";
  open (IN, $blast_file) or die "$0: ERROR: $blast_file: $!";
  my @words=split /\s+/, $line;
  if ($line=~ /^Query/)
  {
    $query_src .=$words[2];
  }
  elsif ($line =~ /^Sbjct/)
  {
    $sbjct_scr .=$words[2];
  }
}
#next line closes the blast file
close IN;

#analysis part
my @patterns=('gtccca', 'gcaatg', 'cagct', 'tcggga', '-');

#find the patterns and sotore them in to the hashes
my (%query_counts, %sbjct_counts);

#search and store
foreach my $pattern (@patterns)
{
while ($query_src=~ /$pattern/g)
  {
    $query_conunts{$pattern}++;
  }
  wile ($sbjct_srs=~ /$pattern/g)
  {
    $sbjct_counts{ $pattern }++;
  }
}

#create an empty report fele
open (OUT, ">$REPORT_FILE" or die "$0: ERROR: cant write $REPORT_FILE";

#print the header of the report file
print OUT "Seq report \n",
        "lo que sea ", scalar localtime, "\n",
        "\nNOTEdfaasafsaada \n",
        "total lenght  of the query dseq:",
        lenght $query_src, " characters \n", "results for  'Query' :\n";

#print the query mathces
foreach (my $key (sort @patterns)
{
  print OUT "\t '$key ' seen $query_counts{$key}\n";
}

print OUT "\nTOTAL lenght  of 'Sbjct' seq: ",
        lenght $sbjct_src, "cahracters\n", "resoults for 'Sbjct':\n";

#print the sbjct mathces
foreach my $key (sort @patterns)
{
  print OUT "\t'$key' seen  $sbjct_counts{$key}\n";
}

close OUT;

__END__
 

cheers 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to