• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Any Perl gurus around?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    I normally pick up sample scripts from the web and customize them to fit the need.
    hth

    Comment


      #12
      Originally posted by Cliphead
      Mine's is non-existent but...

      Need to create a script which;

      1. Takes web form information and saves form.txt to a temp directory on the Linux server. The temp dir has to be unique - /temp/5367657653123/form.txt

      2. Run a command like - runme a.out text.out out.bin

      3. The created out.bin needs then to be made available for download by the user from a webpage or emailed to him.

      Sounds simple but I haven't got a clue where to start with this. Any help appreciated.
      Fook thats not a question thats a piece of work To be honest if you know no Perl your better off finding someone else to do it.

      Or do as Andy said find something to crib of and custimise, thats what I tend to do.

      Comment


        #13
        Originally posted by Ivor1
        Fook thats not a question thats a piece of work To be honest if you know no Perl your better off finding someone else to do it.
        awright, I give in, gimme a price
        Me, me, me...

        Comment


          #14
          Originally posted by Cliphead
          Mine's is non-existent but...

          Need to create a script which;

          1. Takes web form information and saves form.txt to a temp directory on the Linux server. The temp dir has to be unique - /temp/5367657653123/form.txt

          2. Run a command like - runme a.out text.out out.bin

          3. The created out.bin needs then to be made available for download by the user from a webpage or emailed to him.

          Sounds simple but I haven't got a clue where to start with this. Any help appreciated.
          Firstly, if I'm understanding you correctly, you need to insert code in the form's POST handling.

          You can gather the HTTP POST variables there, and format them into a text file (or an XML file if you want to be fancy) and save it to any dir you have write access to. You can easily generate a random temp filename (google for that or look at http://search.cpan.org/~jhi/perl-5.8.0/lib/File/Temp.pm.

          I don't understand what you want to do from there on from your description.

          Perhaps you could elucidate.
          Last edited by bogeyman; 12 February 2007, 16:13. Reason: bbs code fecks up URLs

          You've come right out the other side of the forest of irony and ended up in the desert of wrong.

          Comment


            #15
            Originally posted by bogeyman
            Firstly, if I'm understanding you correctly, you need to insert code in the form's POST handling.

            You can gather the HTTP POST variables there, and format them into a text file (or an XML file if you want to be fancy) and save it to any dir you have write access to. You can easily generate a random temp filename (google for that).

            I don't understand what you want to do from there on from your description.

            Perhaps you could elucidate.
            There is a custom executable on the box which creates a file called out.bin to go the user, this is a software registration exercise. after form.txt gets written to the temp directory the command is run with 3 arguments (which are files), and the output file made available to the user to download or have it emailed to him.
            Me, me, me...

            Comment


              #16
              Originally posted by Cliphead
              There is a custom executable on the box which creates a file called out.bin to go the user, this is a software registration exercise. after form.txt gets written to the temp directory the command is run with 3 arguments (which are files), and the output file made available to the user to download or have it emailed to him.
              So what does the 'out.bin' creator executable need in the way of input?

              A text file with form data - but in what exact format?

              You've come right out the other side of the forest of irony and ended up in the desert of wrong.

              Comment


                #17
                Originally posted by bogeyman
                So what does 'out.bin' need in the way of input?

                A text file with form data - but in what exact format?
                The command line would be;

                cryptest.exe a.out input.txt disregard.txt output.bin

                Run from the temp directory, as long as the form.txt lives there, out.bin is created. text file just plain like:

                PURCHASE_DATE=12/02/2007
                PURCHASE_ID=0
                RUNNING_NO=1
                PRODUCT_ID=215790
                LANGUAGE_ID=2
                QUANTITY=1
                REG_NAME=Peter "Test" Müller
                ADDITIONAL1=
                ADDITIONAL2=
                RESELLER=
                LASTNAME=Müller
                FIRSTNAME=Peter
                COMPANY=
                [email protected]
                PHONE=
                FAX=
                STREET=
                ZIP=
                CITY=
                STATE=
                COUNTRY=
                Me, me, me...

                Comment


                  #18
                  Originally posted by Cliphead
                  awright, I give in, gimme a price
                  May be worth speaking to that code monkey who is on here sometimes, Bob Shawadewadee or something.

                  Comment


                    #19
                    Originally posted by Cliphead
                    The command line would be;

                    cryptest.exe a.out input.txt disregard.txt output.bin

                    Run from the temp directory, as long as the form.txt lives there, out.bin is created. text file just plain like:

                    PURCHASE_DATE=12/02/2007
                    PURCHASE_ID=0
                    RUNNING_NO=1
                    PRODUCT_ID=215790
                    LANGUAGE_ID=2
                    QUANTITY=1
                    REG_NAME=Peter "Test" Müller
                    ADDITIONAL1=
                    ADDITIONAL2=
                    RESELLER=
                    LASTNAME=Müller
                    FIRSTNAME=Peter
                    COMPANY=
                    [email protected]
                    PHONE=
                    FAX=
                    STREET=
                    ZIP=
                    CITY=
                    STATE=
                    COUNTRY=
                    Ok.

                    So capture the vars in the form post handler, get a temp file name, write the file in the format above.

                    Because the web server can't initiate cryptest.exe, you'd need to have a daemon to check the temp dir for the form capture files and then:

                    1) kick off cryptest.exe with the right args

                    2) delete (or move) the capture file.

                    You've come right out the other side of the forest of irony and ended up in the desert of wrong.

                    Comment


                      #20
                      Originally posted by bogeyman
                      Ok.

                      So capture the vars in the form post handler, get a temp file name, write the file in the format above.

                      Because the web server can't initiate cryptest.exe, you'd need to have a daemon to check the temp dir for the form capture files and then:

                      1) kick off cryptest.exe with the right args

                      2) delete (or move) the capture file.
                      Thanks, I can easily create a form I think, I'll plug away with the rest.
                      Me, me, me...

                      Comment

                      Working...
                      X