in reply to capture STDERR from within code?
You can redirect it to a file or variable ( redirecting STDERR ) or capture it and deal with it later ( capturing STDERR - i personally like Capture::Tiny for this... ). Loads of examples out there! HTH.