You didn't mention if you were using LWP::UserAgent to fetch the pages, but, if that is the case, then it's simply a matter of setting the proxy in the user agent object.
First, create the user agent:
$ua = new LWP::UserAgent;
Next, set the proxy in the user agent:
$ua->proxy('http', 'http://proxy.mylocalproxy.com:8001/');
Then, do the request:
$ua->simple_request($request)
Note: The docuemntation gives more details: The $request should be a reference to a HTTP::Request object with values defined for at least the method() and uri() attributes.