Subject: | No (easy) way to report an error when scan() is given a file with an incorrect extension |
Consider this idea:
$ mv foo.mp3 foo.wma
If I do this, and then try to Audio::Scan->scan("foo.wma") I'll get
something like this printed to STDERR:
Invalid ASF header: foo.wma
Expecting: 75b22630-668e-11cf-a6d9-00aa0062ce6c
Got: 4490fbff-0000-0000-0000-000000000000
No sense of an error is reported back from scan. While this is not
insurmountable to the determined perl hacker, your routine should tell
the caller that "I couldn't scan this file properly" in some form or
another. I think replacing things like
PerlIO_printf(PerlIO_stderr(), "Invalid ASF file: %s (Invalid Index
object)\n", file);
with
croak("Invalid ASF File: %s", file);
might be in order. At the very least, not returning a valid hash
reference would be a good signal to the caller. Thanks for an otherwise
decent module!