in reply to Re: Passing and recieving params
in thread Passing and recieving params

Ok,

I was trying to get this first script to get the input from either the command line or web page.

Based on the input, being either two files or a single sequence, one of two scripts would execute, called from within the first cgi script.

MonkPaul.

Replies are listed 'Best First'.
Re^2: Passing and recieving params
by ikegami (Patriarch) on Jul 15, 2005 at 16:34 UTC
    Why don't you convert the script's guts into a module, and write two simple interfaces (CGI and commandline) which use the module?
    # script.cgi use CGI; use BlastTool; ... get info from CGI object ... BlastTool::do_it( $date, $show_filter, ... \@chromo_filter, \@advanced_filter );
    # script.pl use BlastTool; ... prompt the user for the info ... BlastTool::do_it( $date, $show_filter, ... \@chromo_filter, \@advanced_filter );

    Arrays are passed by reference to avoid being flattened.

      I suppose that is one option.But i have a load of other modules to call from within the BlastTool.cgi script.

      I was just trying to do this to try and learn how to execute another script really so i know personally what i am doing in the long run.

      Over all i have

      ComLine.pm MergeFiles.pm parseFiles.pm Email.pm Filter.pm FilterHeader.cgi runBlast.cgi
      I was just trying to get the first script to be an input one, then actually perform the tasks after the input has been gathered.

      I have really ballsed up the writing of this code as its currently all in one cgi file with separate functions, so i am in the process of trying to split it all up and get it to work properly from within different modules. Im ok with calling the modules from within the BlastToolcgi, but i just wanted to get the input in a separate script and possibly implement a loading page too.

      Argggggggghhhhhhh, what have i done!!

        i have a load of other modules to call from within the BlastTool.cgi script.

        So what's the problem? The BlastTool module (formerly BlastTool.cgi) can still load all the modules it wants.

        I was just trying to do this to try and learn how to execute another script really so i know personally what i am doing in the long run.

        What we're seeing is "I want to wash my cat, so can you teach me how to neuter a cat? I know what I am doing in the long run." This communication problem is making it rather hard to help.