rocky karhe <[EMAIL PROTECTED]> wrote: Rocky, please use a better, more descriptive subject in the future. Everyone who comes here needs help. Your message subject should refer to the subject of your question.
: can anybody tell me meaning of following : : my $q=CGI->new(); Create a new CGI.pm object named $q. : my ($html); Unwisely pre-declare $html for some unknown reason. : my %ARGS; : : foreach ($q->param()) { $ARGS{$_}=$q->param($_);} Also written as: my %ARGS; $ARGS{$_} = $q->param($_) foreach $q->param(); or: my %ARGS = $q->Vars; Many people seem to have a penchant for placing the CGI object parameters inside a hash. Personally, I find this a poor practice. It is very unusual that someone needs a second copy of these parameters. And the object can be changed as easily as a hash. %ARGS is probably in ALL CAPS to indicate that it will be a globally used variable. Another poor programming practice (IMO). : $ARGS{'form'} = "" if(defined($ARGS{'form'}) == 0); : $ARGS{'action'} = "" if(defined($ARGS{'action'}) == 0); Same as: $ARGS{form} = '' unless defined $ARGS{form}; $ARGS{action} = '' unless defined $ARGS{action}; There is always a chance that the script is being run from somewhere other than the form created for it. In an LWP script for example. The only way that the 'form' and 'action' fields could be undefined is if they were not in the CGI object to begin. : $ARGS{'completeurl'} = $q->self_url(); : : my $modeform = $ARGS{"form"}; : my $modeaction = $ARGS{"action"}; I don't know why these are being assigned. It is unlikely they will be used more than once. : $ARGS{'error'}=""; : : if($modeform eq "") : { This is used to test the value in $modeform which is the value in $ARGS{form}. I don't know the author's reason for the name change before the test. : if ($modeaction eq "Login") This is used to test the value in $modeaction which is the value in $ARGS{action}. I don't know the author's reason for the name change before the test. Better written as: my $q = CGI->new(); $q->param( 'form', '' ) unless defined $q->param( 'form' ); $q->param( 'action', '' ) unless defined $q->param( 'action' ); $q->param( 'error', '' ); if ( $q->param( 'form' ) eq '' ) { my $html = RMD::LoginProcess($html, %ARGS) if $q->param( 'action' ) eq 'Login'; HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>