Aimal Pashtoonmal wrote: > Hello, > > I have the script below giving the folowing error meesages. > > =>Useless use of string in void context at > extract_data_from_IPR_HMM_libs.pl > line 12. > =>Useless use of a constant in void context at > extract_data_from_IPR_HMM_libs.pl line 13. > > Even though the script works and I get the desired output, what is > causing these messages? > > Also, does anyone know how I introduce a blank line. The script starts > printing out beginning with NAME on the first line. I am trying to get a > blank before every NAME line except the very for first. > > cheers. > > _SCRIPT_ > #!/usr/bin/perl -w > > use strict; > > > my $infile = $ARGV[0]; > my $dataread; > my $line; > my $dbsize; > > > open(INFILE, $infile) || "unable to open file $infile: $! \n"; > open(OFILE, ">$infile.HMMdata") || "couldnt open output file";
right here: open(INFILE, "<", $infile) or die "unable to open file $infile: $!"; open(OFILE, ">", "$infile.HMMdata") or die "couldnt open output file $infile.HMMdata: $!"; > while ($line = <INFILE>) { > $dbsize++ if ( $line =~ /^HMMER/ ); > $dataread = 1 if ( $line =~ /NAME\s/ ); > $dataread = 0 if ( $line =~ /^HMM\s/ ); > > print "$line" if $dataread; > } > > print "Database size for $infile = $dbsize\n"; > > close INFILE; > close OFILE; it's also good programming practice to test close events as well, ala: close INFILE or die "Unable to close filehandle for $infile: $!"; etc... > exit; the script falls off the end here. no reason to explicitly call exit at this point. it's redundant. > _END_ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]