Beginning Perl for Bioinformatics by James Tisdall The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated March 12, 2002. UNCONFIRMED errors and comments from readers: (143) last paragraph; Hi, When I run the subroutine, the error message show that: syntax error at c7_s4.pl line 76, near ") {" Global symbol "$count" requires explicit package name at c7_s4.pl line 78. Global symbol "$length" requires explicit package name at c7_s4.pl line 78. syntax error at c7_s4.pl line 79, near "}" Execution of c7_s4.pl aborted due to compilation errors. ##################################### sub match_percentage { my ($string1,$string2) =@_; #assume the two strings with same length my $length=length($string1); my ($position); my ($count) =0; for ($position=0; $position < $length; ++$position) { if(substr($string1, $position, 1) eq (substr($string2, $position, 1)) {++$count;} } return $count/$length; }