in reply to Short example using IPC::Open2 or IPC::Open3
Is HTTP an option? Commands, responses and error messages are already segregated — that's the hard part — so it easily achieve your goal using a small client driving a small CGI script.
Client:
my @files = do { my $list_response = $ua->get("$uri?action=list_files"); if (!$list_response->is_success()) { die(...); } split /\n/, $response->content() }; for my $file (@files) { my $esc_file = uri_escape($file); my $get_response = $ua->get( "$uri?action=get&file=$esc_file", ":content_file" => $file, ); if (!$get_response->is_success()) { unlink($file); warn(...); next; } my $move_response = $ua->post( "$uri?action=move&file=$esc_file", ); if (!$move_response->is_success()) { warn(...); next; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Short example using IPC::Open2 or IPC::Open3
by Limbic~Region (Chancellor) on Oct 23, 2007 at 20:35 UTC | |
by ikegami (Patriarch) on Oct 23, 2007 at 21:07 UTC |