in reply to prevent perl script running from browser

This behaviour is intended, see e.g. here.
If it should not be executed upon browser request, then move it somewhere else, so that it can't be accessed that way.
  • Comment on Re: prevent perl script running from browser

Replies are listed 'Best First'.
Re^2: prevent perl script running from browser
by snowchild (Novice) on Oct 01, 2017 at 04:51 UTC
    Thank you. Is there some code I can put at the top of the script to check that it is being fun from the server and quit if it's not? I would rather not move it outside of cgi-bin and not sure that would solve the problem anyway unless it were moved outside the public_html directory.
      One possibility is that you could examine the HTTP_REFERRER.

      When called from a web page, this is usually set.

      If your "server" calls do not set this, or set it to a specific valye, you could use this as a detection mechanism.

      Your question is a little strange, so I will not comment on the relative in-security of this method.

                      All power corrupts, but we need electricity.

        You alter/assign referrer, either in perl scripting or browser plugin.