On Sat, 17 May 2008, Aristotle Pagaltzis wrote: > * David Fleck <[EMAIL PROTECTED]> [2008-05-17 14:40]: > > (Incidentally, I do declare a plan, a few lines further down in > > the test script: > > > > plan tests => scalar (@file_objects) * 17; > > > > but I didn't think that was needed in the BEGIN block.) > > Yes it is. The BEGIN block runs before everything else, and by > that time your `plan` line has not executed, so it leads to the > complaint you are seeing, that you are running a test before you > set a plan. So you would need to put that line in a BEGIN block > above the one with the `use_ok` line.
Ok, I understand now. I was attempting to leave the number of tests variable based on the size of the test array, *and* I was attempting to use 'use_ok'. It looks like I can do one or the other, but not both. > But is there a reason you are using `use_ok`? I find that people > use it a lot in situations where plain `use` would be better. I'm using it only, and entirely, because the POD suggests using it. :) But on reflection, I agree that just using 'use' works just as well, and allows me to avoid having to specify the exact number of tests to run until runtime. Thanks to all who replied. -- David Fleck [EMAIL PROTECTED]