in reply to Problems calling a second perl script from the first

So, I've taken the "short road" to the intended goal. I've just put the graph generating routine in the main script, it works now, via saving the image first on the server and displaying it. It's not a good solution but a working one. By time I will try to migrate these little "script pages" onto another system, like the "Template::Toolkit" or via Mojolicious/Dancer2/Catalyst. "Solution" for my problem:
my $safe_filename_characters = "a-zA-Z0-9_.-"; sub PLOTTING { my ($GRAPH_FH, $mygraph, $graphimage); open ($GRAPH_FH, '>','/home/deruytja/webserver/output/multiping/'.$gra +phname.'.png'); #Redirecting Standart Error to file $mygraph = GD::Graph::linespoints->new(500, 300); $mygraph->set( x_label => 'Link', y_label => 'Antwortzeit in ms', title => 'Antwortzeiten der Links', dclrs => ['green'], y_max_value => $max, bar_spacing => 10, show_values => 1, ) or warn $mygraph->error; $graphimage = $mygraph->plot(\@graphdata); binmode $GRAPH_FH; print $GRAPH_FH $graphimage->png; close $GRAPH_FH; }

Also I modified the upload script after encountering problems regarding filenames (If they've got ä/ö/ü in it) like this:

sub UPLOAD { my $filename = $cgi->param('toping'); if ( !$filename ) { print $cgi->header ( ); print 'There was a problem uploading your file (try a smaller file +).'; exit; } my ( $name, $path, $extension ) = fileparse ( $filename, '..*' ); $filename = $name . $extension; $filename =~ tr/ /_/; $filename =~ s/[^$safe_filename_characters]//g; if ( $filename =~ /^([$safe_filename_characters]+)$/ ) { $filename = $1; } else { print $cgi->header(); print 'There was a problem with the filename (please rename).'; exit; } my $wfile = $cgi->upload('toping'); open(my $DAT,">", "/home/deruytja/webserver/rifucgi/temp_ul/toping.$da +te") or die 'Error processing file INPUT: ',$!; binmode $DAT; while (read $wfile, $data, 1024) { print $DAT $data } close $DAT; }

The user could also give the output file a name, which would encounter the same problems with the characters, solved via this piece of code:

if (!length($dateiname) == 0 && $dateiname =~ /^([$safe_filename_chara +cters]+)$/) { $out_file = ("$dateiname\_$date.csv") or die 'Error processing + file: ',$!; $graphname = "$dateiname\_$date"; } else { print $cgi->header(); print 'There was a problem with your file name, it was reverte +d to "ping_" (please change output name).'; $out_file = ("ping_$date.csv") or die 'Error processing file: +',$!; $graphname = "ping_$date"; }