- a do is only 'largely' like an eval - this is one of the respects in which it differs
- the script that you do may be physically in another file, but when you do it, it is as if it is part of the file where the do is
I worked round this by putting a package X at the top of b.pl, no doubt there are other ways.