in reply to Can't locate object method "file" via package "URI::http"

First of all, why are you using obsolete module URI::URL instead of URI? See the first line of the docs.

Secondly, I don't see anything that suggests that URI::URL provides a file method. The local_path method might do the trick (misreferenced as localpath).

Update: Nope, that only works for URIs using the file: scheme. The confusion is understandable since you're using an obsolete, undocumented module.