Did you write the code you posted?

Don't use ReadParse , see Re: Manually add parameters in perl cgi ( no ReadParse no CGI->Vars

Also if you got CGI.pm , use its API, no looking at %ENV :)

#!/usr/bin/perl -- #~ ## #~ ## #~ ## #~ ## #~ ## perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END " -otr -opr - +ce -nibc -i=4 -pt=0 "-nsak=*" #~ ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -o +pr -ce -nibc -i=4 -pt=0 "-nsak=*" #~ ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if while " - +otr -opr -ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use CGI (); use CGI::Carp qw( fatalsToBrowser ); Main( @ARGV ); exit( 0 ); sub Main { my( $configref ) = require './mymodule-lib.pl'; my $q = CGI->new; if( $q->request_method eq 'POST' ) { return print SaveFormRedirect( $configref->{info}, $q ); } else { return print ShowStuff( $configref, $q ); } } ## end sub Main sub SaveFormRedirect { my( $conf, $q ) = @_; write_file( $conf->{'info'}, $q ); return $q->redirect( UrlFor( $q, 'index.cgi' ) ); } ## end sub SaveFormRedirect sub UrlFor { my( $q, $modepath ) = @_; my $url = $q->url( -absolute => 1, -path => 1, ); return $url . '?' . $modepath; } ## end sub UrlFor sub ShowStuff { my( $conf, $q ) = @_; return join '', ui_print_header( undef, "Configuration Information", "", undef, +1, 1, 0 ); ui_form_start( UrlFor( $q, "index.cgi" ), "post" ), ui_table_start( "Configurations", undef, 2, ["width=30%"] ), ui_table_row( "Bandwidth", ui_textbox( "bandwidth", scalar $q->param( 'bandwidth' ), 80, +0, 40, ) ), ui_table_row( "Distance", ui_textbox( "distance", scalar $q->param( 'distance' ), 80, 0, + 40, ) ), ui_table_row( "Size", ui_textbox( "size", scalar $q->param( 'size' ), 80, 0, + 40, ) ), ui_table_row( "Active", ui_yesno_radio( "active", scalar $q->param( 'active' ) ? 1 : 0 +, 1 ) ), ui_table_end(), ui_form_end( [ [ undef, "submit" ] ] ), ui_print_footer( "/", scalar $q->param( 'index' ) ), ; } ## end sub ShowStuff __END__

In reply to Re: ReadParse and Hash Value by Anonymous Monk
in thread ReadParse and Hash Value by maruti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.