Sorry about that, I renamed the variable part way through and didn't fix that one.
XDaemon, thanks. I didn't have mIRC in front of me to figure out the internal loop in $findfile and since I rarely use it, I didn't have the syntax memorized for it. Also, good point on using $sdir.