linex has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: reverse script
by Happy-the-monk (Canon) on Mar 20, 2004 at 19:50 UTC

    I don't understand what your idea of reverse is in the context.

    There's a module called CGI.pm for many operations to feed the browser with HTML code. Have a look at that. Or is your problem related to some other difficulty? Like, how to list a directory?

    Sören

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: reverse script
by pboin (Deacon) on Mar 20, 2004 at 19:53 UTC

    Not so sure it can be done, not if I understand you correctly.

    No webserver is going to execute code that is sent by a browser, they are not really in the business of two-way communication.

    You are going to need server access. Now, if you do have that, you'll be able to write whatever you want on the server end -- some kind of program to return the results you're looking for. But, as far as the browser submiting perl code for execution, I don't think that's such a good idea.

      Hmm, "simple", feed a form to a perl programme to eval the contents, print back output and error messages, if any. Though that could easily be done, it is highly dangerous. If you can execute arbitrary code on that machine through a web form, so could others too.

      Sören

Re: reverse script
by TomDLux (Vicar) on Mar 21, 2004 at 23:48 UTC

    The viewer enters a Perl script into your web page form, the server runs the script, and returns a list of directories.

    There seem to be a few steps missing.

    How do you know the viewers script generates a list of directories? it might delete every file it encounters, or count the number of jelly beans that fit between the earth and the moon, or, more likely, not do anything useful, or be incorrect.

    If you want visitors to explore your directory hierarchy, how about displaying the top-level directories as checkbuttons, allowing the visitor to select on and drill down through your file system. But why would anyone want to explore your layout, other than a hacker looking for ways to break in.

    Why not think about what you really want the viusitor to achieve, and ask questions about that?

    --
    TTTATCGGTCGTTATATAGATGTTTGCA