#!/usr/bin/perl use warnings; use strict; use HTTP::Proxy; use HTTP::Recorder; # create a new HTTP::Recorder object my $agent = HTTP::Recorder->new( file => "/home/user/tmp/my_output_file.pl" ); my $proxy = HTTP::Proxy->new( port => 4567, agent => $agent ); # start the proxy $proxy->start();