The error message is the clue. You've got conflicting mismatching files.
Either get rid of them (delete/overwrite),
or install to a different location,
or call the right perl binary ($PATH),
or sanitize your environment variables (PERLLIB/PERL5LIB).
Thanks for your reply. You give my very good advice. Nevertheless, it doesn't answer my question. My question was: "Why does it works on the second run of the script?". Thats what I'm trying to figure out.