Loading ...
Sorry, an error occurred while loading the content.

code comments...

Expand Messages
  • prakash
    This code is working fine.. but I am interested in creating CLEAN and BEST code.. I never say my code is the best code.. always there is possibility for
    Message 1 of 6 , Nov 1, 2002
    • 0 Attachment
      This code is working fine.. but I am interested in creating CLEAN and BEST
      code..
      I never say my code is the best code.. always there is possibility for
      improvement
      Please pass your valuable suggestion to improve the code... thank you very
      much..


      #!/usr/bin/perl -w
      $|=1;

      use lib '/home/aebolts/cgi-bin/PM';
      use strict;
      use Pros;
      use CGI::Carp qw(fatalsToBrowser);
      use CGI qw(:standard);

      my $username = cookie('user');
      if($username){
      my $cgi = new CGI;
      my $aPros = Pros->new($username);
      if($cgi->param('add')) {
      if(!$cgi->param('view'))
      { if(!$aPros->addInfo($cgi)){$aPros->printAll();} }
      $aPros->printAddNew();
      }
      elsif($cgi->param('update')) {
      $aPros->update($cgi);
      }
      elsif($cgi->param('aprospect')) {
      if(!$cgi->param('view'))
      { if($aPros->uploadInfo($cgi)){ $aPros->printAll(); } }
      $aPros->printViewProspect();
      }
      elsif($cgi->param('upload')) {
      if($cgi->param('file'))
      { if($aPros->uploadProspects($cgi)){ $aPros->printAll(); } }
      $aPros->printUploadNew();
      }
      else{
      $aPros->printAll($cgi->param('sort'));
      }
      }
      ######## PROGRAM HAS NO COOKIE TO EAT ##############################
      else{
      print header();
      print qq~<meta http-equiv="refresh" target="new"
      content="0;URL=http://www.asdfasdf.com">~;
      }

      exit(0);
    Your message has been successfully submitted and would be delivered to recipients shortly.