%my $debug=0; # toggle debug %my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_external ); %my @field_descriptions = ( 'prev date', 'curr date', 'prev reading', % 'curr reading', 'tdsp', 'meter mult', % 'total usage', 'measured demand', 'billed demand', % 'svcnum', 'entry date', 'meter number' ); %my @field_name = qw / prev_date curr_date prev_read curr_read tdsp % meter_multiplier total_usage measured_demand % billed_demand svcnum _date meter_number /; %my $date_exception = '(prev_date|curr_date|_date)'; % %if ( $cgi->param('error') ) { % ### handle error call % $svcnum = $cgi->param('svcnum'); %} %else { % % my($query) = $cgi->keywords; % $query =~ /^(\d+)$/ or die "unparsable svcnum"; % $svcnum=$1; % %} % %# this is sample data for print in case no previous record of usage_elec %my @sample_data = ( '20070201', '20070228', '10000', '100100', '76.50', % '5', '500', '179', '220', "$svcnum", 'NA', '030234972LM'); % %### this is where i start %### %### let gather all the info from usage_elec for the particular 'svcnum' %### %my $p1 = popurl(1); % %print qq!Error: !, $cgi->param('error'), % "" % if $cgi->param('error'); % %print qq!