#!/usr/bin/perl use strict; use CGI; use CGI::Carp qw( fatalsToBrowser ); my $cgi = new CGI(); my $url = $cgi->url(); my $testdata = ""; print "Content-type: text/html\n\n"; print "\n"; print " \n"; print " This script accepts input in the 'Input' area, then passes\n"; print " that input exactly as entered to the value fields of\n"; print " the different HTML elements. To use the script:\n"; print "
    \n"; print "
  1. enter the text you want to test
  2. \n"; print "
  3. press submit this will pass the text to the elements in the browser
  4. \n"; print "
  5. review the contents of the fields
  6. \n"; print "
  7. press submit again this will pass the text back to the script
  8. \n"; print "
  9. review the 'Received' data.
  10. \n"; print "
\n"; print "

Input\n"; my $text = $cgi->param('input'); my $tmp; if( $text ) { $testdata = $text; $tmp = $text; $tmp =~ s/(\W)/'#'.ord($1).';'/ge; print "Received input: '$tmp'
"; } print " \n"; print "

input type='text'

\n"; $text = $cgi->param('textfield'); if( $text ) { $tmp = $text; $tmp =~ s/(\W)/'#'.ord($1).';'/ge; print "Received textfield: '$tmp'
"; } else { $text = $testdata; } print " textarea\n"; $text = $cgi->param('textarea'); if( $text ) { $tmp = $text; $tmp =~ s/(\W)/'#'.ord($1).';'/ge; print "Received textarea: '$tmp'
"; } else { $text = $testdata; } print " \n"; print "

input type='hidden'

\n"; $text = $cgi->param('hidden'); if( $text ) { $tmp = $text; $tmp =~ s/(\W)/'#'.ord($1).';'/ge; print "Received hidden: '$tmp'
"; } else { $text = $testdata; } print " \n"; print " \n"; print " \n"; print " \n"; print "\n";