use strict; use warnings; use LWP; my $base_url = 'http://dis.embl.de'; my $protein = 'MSSSTPFDPYALSEHDEERPQNVQSKSRTAELQAEIDDTVGIMRDNINKVAERGERLTSI'; my $browser = LWP::UserAgent->new; $browser->env_proxy(); my $response = $browser->post( "$base_url/cgiDict.py", # That's the URL that the real form submits to. [ key => 'process', SP_entry => '', sequence_string => $protein, smooth_frame => '8', peak_frame => '8', join_frame => '4', fold_coils => '1.20', fold_rem465 => '1.20', fold_hotloops => '1.40', plot_title => '', doApplet => 'true', tango_PH => 7.40, tango_T => 298.15, tango_I => 0.02, tango_TFE => 0.00, fold_tango => 1.00, ] ); die "Error: ", $response->status_line, "\n" unless $response->is_success; my $html = $response->content; my ($eps) = ( $html =~ m{Download PostScript file} ) or die; $response = $browser->get("$base_url/$eps"); die "Error: ", $response->status_line, "\n" unless $response->is_success; my $out_path = 'tmp.eps'; open my $out_fh, '>', $out_path or die "Can't write-open out_file: $!"; print {$out_fh} $response->content; close $out_fh; system( 'C:/Program Files/Ghostgum/gsview/gsview32.exe', $out_path );