in reply to From MySQL MP3 Database to CD-R

First, nice piece of work. A couple of comments:
  1. Setting $FilesFound to 'Y' or 'N' isn't doing what you seem to expect it to. Logical tests of $FilesFound will always be true. Use 0 and 1 instead.

  2. You're going to run into trouble the first time you hit an album name that has quotes in it. You can avoid this by using bind variables in your SQL queries, and pass the actual arguments to prepare(). Let MySQL do the quoting for you.

  3. Setting RaiseError=1 when you connect might save you some SQL debugging grief.

  4. A slight stylistic nit. return isn't a function call. I find it clearer to write   return @returnlist; than to write   return(@returnlist); which, on a quick skim, is easy to miss if one is focusing on control flow. This is a point on which reasonable people disagree.

Replies are listed 'Best First'.
(shockme) Re: Re: From MySQL MP3 Database to CD-R
by shockme (Chaplain) on Jan 18, 2002 at 07:13 UTC
    1. Doh! It's been fixed. ++.

    2. This is a good point. For my stuff though, I take care of the quotes when the CD is ripped. Still, your point is well taken. Once again, ++.

    3. I'm just beginning to work my way through Programming the Perl DBI, and setting the RaiseError flag hasn't become second nature yet. ++.

    4. You say tomato, I say tomato. Hrm....that doesn't translate very well in print....;)

    If things get any worse, I'll have to ask you to stop helping me.