Passing data from a HTML form to perl script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krus
    New Member
    • May 2010
    • 1

    Passing data from a HTML form to perl script

    Hi All,

    I am relatively new to HTML and perl scripts. I am writing a HTML page which has a form. It takes two inputs. Now I want pass these two inputs from the HTML form to the perl script. I want to use these two inputs to open specific files and diff them using the perl script. Can any one please help me?

    Code:
    HTML:
    
    <form name="compare" action= "Diff.pl" method="post">
    <table align="center">
    First:<input type="text" name="first" value="0" size ="3" maxlength="2"/>
    Second:<input type="text" name="second" value="1" size ="3"maxlength="2" />
    <input type="SUBMIT" WIDTH=10 VALUE="GO" />
    </table> 
    </form> 
    
    PERL File:
    #!/usr/bin/perl
    
    $I1 = shift;
    $I2 = shift;
    
    system ("diff \\SomeLocation\folder_$I1/File_$I1.txt \\SomeLocation\folder_$I2/File_$I2.txt ");
    unlink (" \\SomeLocation\folder_$I1/File_$I1.txt ");
    unlink (" \\SomeLocation\folder_$I2/File_$I2.txt ");
    Looking forward to some solution. Thanks.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Start by reading the documentation for the CGI module.

    Comment

    Working...