$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 }