I tried SQL::Parser but it failed to read the whole SQL dump, complained about "---"
If that means the lines beginning with double-dashes then you can just strip those out - they are only notes from mysqldump and can be ignored. You can avoid them in the first place by using mysqldump --skip-comments instead.
This small issue is part of my efforts to upgrade a DB schema (by adding or removing table columns), processing the database data and inserting it back into the DB
There will be some reason you are not just doing this entirely inside the DB but I can't imagine what that reason might be.