in reply to controlling script verbosity
I don't know how complicated you plan on making this, but for my simple debug messages I just use
$debug > 2 && print 'This is a very verbose message.';
I'm sure that's not the most flexible or optimized solution, but it works for most things.