if you mean the source of the output, then LWP::Simple (see also this recent node: opening a webpage's source).
If you mean the actual (for example) perl source of a url like http://example.com/cgi-bin/foo.pl then no, it's not possible if the example.com's web server is configured properly. (if it were allowed it would be a huge security risk because people would be able to see the internals of your code) | [reply] |
Seeing code should not be a security risk. Your code should not contain embedded passwords, etc. Also, the Open Source movement has shown that open and available code, combined with a mechanism for others to review and submit changes to that code, results in better security (in general).
The reason script source isn't available is rather one of these:
- The source embodies a trade-secret or some sort of intellectual property.
- Script-capable web servers are configured to execute that code, so no mechanism is in place to simply tranfer it -- putting the file up in a downloadable form is an extra step, and most people simply don't bother.
- The code is either trivial or publicly available from a different forum (e.g. the Scoop code that drives Kuro5hin has its own site, so Kuro5hin doesn't publish it on the main site).
Larry Wall is Yoda: there is no try{}
The Code that can be seen is not the true Code
| [reply] |
Any client-side script can be downloaded by viewing the source of the page (for inline script) or going to the script itself (for externally referenced script).
Server-side script (in most cases) cannot be downloaded. | [reply] |
I have found one code but I can not get it since host is old and is not supported anymore.
Monk, why do I get the idea you are trying to do
something you aren't implicitly allowed to do? If you can't
get access to the script itself there must be a reason.
Leave well enough alone.
CGI script run on the server side not on the client
side. A well formed CGI just outputs HTML to the browser.
You can look at that just fine using the "View Source" function of your browser.
| [reply] |