$dbentry = "BPM-$info.txt"; #add DB prefix if (-e $dbentry) { #check if file already exists (it should't) open(DBENTRY, ">>$dbentry") || die "cannot open file $dbentry\n"; #open w/ error handling print DBENTRY "$info\n "; #append Album info (shouldn't have to append) close(DBENTRY); #make sure we're all neat } else { #we should be creating a new file open(DBENTRY, ">$dbentry") || die "cannot create file $dbentry\n"; #open w/ error handling print DBENTRY "$info\n "; #add the Album info close(DBENTRY); #make sure we're all neat } #### $dbentry = "BPM-$info.txt"; #add DB prefix open(DBENTRY, ">>$dbentry") || die "cannot open file $dbentry: $!"; #open w/ error handling print DBENTRY "$info\n "; #append Album info close(DBENTRY); #make sure we're all neat #### @files = (@files, $name); #add it! #### push @files, $name; #add it! #### $ perl -Wc bpm.pl Found = in conditional, should be == at bpm.pl line 33. #### if ($flag eq "yes") { #if the flag is on #### foreach my $filename ( @files ) { #for each filename in the array open(PHILE, '<', $filename) || die "cannot open $filename: $!"; #open file w/ error handling my @lines = scalar ; #get the Artist/Album info while ( ) { push @lines, $_ if /$bpm/; } if ( @lines > 1 ) { print @lines; } else { print "sorry, no matching BPMs found."; #deliver the bad news } close PHILE; #finish up }