For problem #1 I recommend you include how the code you are calling uses the encoding_detect() function of XML::SAX::PurePerl. If you read the code you'll see that the warning you are seeing appears at the end of the function if none of the conditions it is looking for are satisfied.
For #2 I don't see any proj_init function:
pdl> help pj_init
No PDL docs for 'pj_init'. Using 'whatis'. (Try 'apropos pj_init'?)
So I guess you'll need to show some more code for that one as well.
Celebrate Intellectual Diversity