Not even you can determine if something from one of those modules is used without careful inspection (which amounts to running the code in your mind) or running the code, carefully probing for breakage. You will need to reason through all of your code to determine if you need a module or not. A good way to cheat is to avoid any exports via use MODULE::NAME (); You are asking to do something that could potentially be undecidable.
But nothing at all for Perl. I guess what I'll probably go with, if nobody has a better idea, is something like that script for C files, like comment out the "use" line and see if it passes its tests.