in reply to Re^3: Problems calling a second perl script from the first
in thread Problems calling a second perl script from the first

I've tried it now with the $cgi->upload('toping') version and also with your version, still no luck.

To clarify what the script should do (and normally does very well), I'll explain a bit: The whole script is just a multiping utility where a user is allowed to upload a file containing IP adresses and labels, so I need to write an upload routine, process the uploaded file and ping the devices inside.

As we've got another project I needed to take a look at the GD::Graph module. To get to know the module I wanted to implement it to the existing ping utility.

In my understanding, the whole problem is that the subscript for plotting the graph needs to "check" all the variables in the "multiping-script" (Which I don't understand as it only uses the "our" variables) and doesn't like the empty "filehandle" with which I upload the file at first

If the "multiping-script" is started at first (via the HTML page) the "filehandle" is filled, as their is user input, the second time the "multiping-script" is called (via the graph script) the "filehandle" is empty (which is correct as their are no parameters given)

Is there a way to bind these 2 scripts together without the check on the variables which aren't needed?

Tomorrow I'll take a look at the Template::Toolkit and maybe change over to this one.

  • Comment on Re^4: Problems calling a second perl script from the first

Replies are listed 'Best First'.
Re^5: Problems calling a second perl script from the first
by soonix (Chancellor) on Apr 14, 2015 at 10:37 UTC

    normally, in HTML, images (such as your graph) are requested separately from the "text", so it would have to be a different script, and the parameters have to come in via URL parameters, which mandates parameter checking, because anyone could call the "image script" by hand.

    It is possible to incorporate images directly with <img src="data:... (see

    So you could call your graph generator directly as a subroutine (with already checked parameters). Of course, your subroutine would have to (base64) encode the image.