Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

find the syntax error!!!

by Anonymous Monk
on Jun 20, 2000 at 15:30 UTC ( #18974=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to run the following programme but the following errors are being complained which I am not able to sort it out!!! syntax error at checkdataperl.p line 249, near "for" syntax error at checkdataperl.p line 250, near "++) " syntax error at checkdataperl.p line 286, near "}" Execution of checkdataperl.p aborted due to compilation errors. Dear Monks pls help me??? #!/usr/local/bin/perl print("\n \nWelcome !! Please input the response very carefully in this programme whenever asked for \n Now please ensure that before running the programme you have run the vp29apr programme for the corresponding hour and also the 1d files for the j or t hour as applicable are has also been run upon \n Now please enter the hour for which you want to check the data quality (a,b,..x) \n?" ); $hour=<STDIN>;chop($hour); print("you entered ", $hour ,"\n"); $comparison=3;@arrone=();@arrtwo=(); @array=("o","p","q","r","s","u","v","w","x","a","b"); if ($hour eq "j") { $comparison=$hour; } elsif($hour eq "t") { $comparison=$hour; } else { for($n=0;$n<=10;$n++) { if($array$n eq $hour) { $comparison="t"; } } } if($comparison ne "t") { if($comparison ne $hour) { $comparison = "j"; } } print("\n the value of comparison is ", $comparison ,"\n"); print ("\n Please enter the allocation no. from which you want to check the data (1-60) \n"); $allocin=<STDIN>;chop($allocin); print ("\n",$allocin,"\n"); use PGPLOT; # Load PGPLOT module print "\nTesting simple point plot...\n\n"; print "PGPLOT module version $PGPLOT::VERSION\n\n"; pgqinf("VERSION",$val,$len); print "PGPLOT $val library\n\n"; # "?" will prompt for device $dev = "/xw" unless defined $dev; pgbegin(0,$dev,1,1); # Open plot device pgscf(2); # Set character font pgslw(4); # Set line width pgsch(1.6); # Set character height #pgask(false); for ($alloc=$allocin;$alloc<=60;$alloc++) { print ("\n",$alloc,"\n"); $i=0;$m=0;$p=0; print "\n We are checking data quality for hour=$hour Alocation= $alloc \n"; $astatname="/tmp_mnt/usr4/mrt/vinayPandey/name".$alloc.$hour."1.astat"; $onedname="/tmp_mnt/usr4/mrt/vinayPandey/name".$alloc.$hour."1.1d" ; if ($comparison ne $hour) { $caldet="/usr4/mrt/vinayPandey/caldet".$alloc.$comparison."1.1d"; open(CALDET,$caldet); $c2=0; $line=<CALDET>; while( $line ne "" ) {chop($line); ($calqone$c2,$calqtwo$c2,$calqthree$c2,$calqfour$c2)=split(' ',$line,4); $line=<CALDET>; $c2++; } } if ((open(NAMEAS, $astatname)) && (open(NAMEONED,$onedname))) { while(<NAMEAS>) { ($arrone$i,$arrtwo$i)=split(' '); $i++; } close(NAMEAS); $n1=$i-1; while(<NAMEONED>) { ($arrthree$m,$arrfour$m)=split(' '); $m++; } } $n2=$m-1; close(NAMEONED); $k=0; for($p=0;$p<=$n1;$p++) { for($n=0;$n<=7;$n++) { chop($arrone$p); } $corresonedname=($arrone$p."1d");$arrone$p=$arrone$p."astat.gz"; if ( -e $corresonedname ) { for($j=0; $j<=$n2;$j++) { if ( $corresonedname eq $arrthree$j) { $arronestore$k=$arrone$p; $arrtwostore$k=$arrtwo$p; $arrthreestore$k=$arrthree$j; $arrfourstore$k=$arrfour$j; if (open(NAME ,"$corresonedname")) { $g=0; while(<NAME>) { # Read data in 2 columns from file handle # and put in two perl arrays chop(); ($y$g,$x$g) = split(/\s+/); $g++; } print ("\ng=",$g,"\n"); close (NAME); } $response="h";$r="f";$ab1=0; while ($response ne "abcde") { @arrsidtime=("a","b","c","d","e","f","g","h","i", "j","k","l","m","n","o","p","q","r","s","t","u","v","w","x"); if ($r eq "f") { $y1=0;$y2=0.1;$fmin=$y[0];$fmax=$y[0]; for ($s1=0;$s1<($g-1);$s1++) { if ($fmax < $y$s1) { $fmax=$y$s1; } if ($fmin > $y$s1) { $fmin= $y$s1; } } print ("\n ymax=",$fmax,"Ymin=",$fmin,"\n"); $y1=$fmin; $y2=$fmax; $y2=($y2+0.1); $y1=($y1-0.1); print ("\n y2=",$y2,"y1=",$y1,"\n"); while( $hour ne $arrsidtime$ab1) { ++$ab1;$ab2=$ab1 + 1;$r="t"; } } pgenv($ab1,$ab2,$y1,$y2,0,0); # Define data limits and plot axes pglabel("X","Y",$corresonedname); # Labels pgsci(5); # Change colour pgline($g,\@x,\@y); print("\n please enter your response for the plot....\n FOR SEEING THE PLOT WITH MODIFIED AXES PLEASE ENTER n \n OR GIVE THE APPROPRIATE QUALITY FACTOR FOR THE FILE FROM 1-9\n ?"); $response=<STDIN>; chop($response); print ("you entered ",$response,"\n"); if ($response eq "n" ) { print ("\n Please enter Xmin value\n"); $abr1=<STDIN>;chop($abr1); if ($abr1 ne "") {$ab1=$abr1;} print ("\n Please enter Xmax value\n"); $abr2=<STDIN>;chop($abr2); if ($abr2 ne "") {$ab2=$abr2;} print ("\n Please enter Ymin value\n"); $yr1=<STDIN>;chop($yr1); if ($yr1 ne "") {$y1=$yr1;} print ("\n Please enter Ymax value\n"); $yr2=<STDIN>;chop($yr2); if ($yr2 ne "") {$y2=$yr2;} } elsif(("123456789" =~ m/$response/) && ($response ne "")) { $quality$k=$response;$response="abcde"; print ("\n aulaity ",$k,"=",$quality$k,"\n"); } else { print "\n please enter proper response\n"; } } if ($comparison eq $hour) { $k++; goto NEXTLINE; } else { $hdiffer = &get_RAdiff_fromsun($comparison,$arrthree$k); if (($quality eq "1") && ($hdiffer >= 2)) { $calfilename=&gencalfn($corresonedname,$comparison) if (-e $calfilename) { $c2=$c2-1; for($c3=0;$c3<=$c2;$c3=$c3++) { if(($calfilename eq $calqname$c3) && ($calqfour$c3 eq "1") && ($calqthree$c3<=100)) { $gooddata="/usr4/mrt/vinayPandey/good".$hour; if (-e $gooddata) {open(FILE, ">>$gooddata"); } else { open(FILE,">$gooddata"); } $qnet=1; print FILE "$arrthreestore$k $arrfourstore$k $arrtwostore$k $quality$k $calqone$c3 $calqtwo$c3 $calqthree$c3 $calqfour$c3 $qnet \n"; close(FILE); $k++; goto NEXTLINE; } else { if ($calfilename eq $claname$c3) { $c2++; $k++; goto NEXTLINE; } } } } } $k++; goto NEXTLINE; } } } } else { print "\n we are not able to find file $corresonedname\n"; } NEXTLINE: } if ( $comparison eq $ hour) { print "\n +++ k= $k"; $k=$k-1;print "\n +++ k= $k"; $calname="/usr4/mrt/vinayPandey/caldet".$alloc.$hour."1.1d"; if (-e $calname) { open(CALNAME, ">>$calname"); } else { open(CALNAME, ">$calname"); } for($c1=0;$c1<=$k;$c1++) { $hdifference=&get_RAdiff_forsun($comparison,$arrthreestore$c1); if ($hdiffernce < 2) { $quality$c1=$quality$c1+$W7; } print CALNAME "$arrthreestore$c1 $arrfourstore$c1 $arrtwostore$c1 $quality$c1 \n"; } close (CALNAME); } else { $k=$k-1; $c2=$c2-1; for($tak1=0;$tak1<=$k;$tak1++) { $calibname=&gencalfn($arrthree$tak1,$comparison); $pos=&get_RAdiff_forsun($comparison,$arrthree$tak1); if (-e $calibname) {$W6=0;$factor="y";} else { $calibnamenew=$calibname; @newarr=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w","24x"); for($st1=0;$st1<=6;$st1++) {chop($calibnamenew);} $b1=chop($calibnamenew); $b2=chop($calibnamenew); $b12=$b2.$b1; $jd1=chop($calibnamenew); $jd2=chop($calibnamenew); $jd3=chop($calibnamenew); $jday=$jd3.$jd2.$jd1; $nlm1=-1; $sn=chop($calibnamenew); $nl=0; while($nl != 5){ for ($ensure=1;$ensure<=2;$ensure++) {$nlm=$nlm1*$nl; $jday=$jday+$nlm; for ($na=1;$na<=4;$na++) { @subsubst=grep(/$na\S/,@newarr); $subsubst[0]=chop($subsubst[0]); for ($nah=1;$nah<=24;$nah++) { @hoursubst=grep(/$nah\S/,@newarr); $hoursubst[0]=chop($subsubst[0]); $caltestname=$calibnamenew.$subsubst[0].$jday.$b12."_".$hoursubst[0].$comparison."1.1d"; if (-e $caltestname) { $calibname=$caltestname;$factor="y"; if ($nl=0) {$W6=0;} elsif($nl<=3) {$W6=3;} else{$W6=5;} goto CHECK; } } } if ($nl eq "0") {++$ensure;} } $nl++; } if ($factor ne "y") {$calibname=$calqone$tak2;} CHECK: for ($tak2=0;$tak2<=$c2;$tak2++) { if ($calibname=$calqone$tak2) { if ($calqthree$tak2<=100){$W4=1;} elsif ($calqthree$tak2<=400){$W4=2;} else{$W4=3;} if ($arrtwostore$k<=100) {$W3=1;} elsif ($arrtwostore$k<=400) {$W3=2;} else {$W3=5;} if ($pos >= 4) { $W5=1; } elsif ($pos >= 2) { $W5=2; } else { $W5=5; } $netquality$tak1=$W1*$quality$tak1+$W2*$calqfour[$tak2+$W3+$W4+$W5+$W6; $calstoreone$tak1=$calqone$tak2; $calstoretwo$tak1=$calqtwo$tak2; $calstorethree$tak1=$calqthree$tak2; $calstorefour$tak1=$calqfour$tak2; goto FIRSTLOOP; } } } FIRSTLOOP: } print ("\n here the actual test starts i.e. comparison etc.....\n" ); } NEXTLINETWO: } LABELEND: pgend; print("\n this is the end of the programme\n"); sub gencalfn { local(@complex,$temp,$calib1,$val1,$val2,$tempx,$tempy,@tempxy,$val3,$calib2,$comparison,$val4); @complex=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w","24x"); $calib1=$_[0]; $comparison=$_1; for ($temp=0;$temp<=3;$temp++) { chop($calib1); } $tempx=chop($calib1);print"\n $tempx==",$tempx; $tempy=chop($calib1);print"\n tempy==",$tempy; @val1=grep(/\d{1,2}$tempx/,@complex);print "\n val1==",$val1[0]; @val2=grep(/\d{1,2}$tempy/,@complex);print "\n val2==",$val2[0]; @val3=grep(/\d{1,2}$comparison/,@complex);;print "\n val3==",$val3[0]; chop($val1[0]);chop($val2[0]);chop($val3[0]);print "\n ",$val1[0]," ",$val2[0]," ",$val3[0]; if ($val1 <3) {$val4=$val1+24-$val3;} elsif ($val1>$val3) {$val4=$val1-$val3;} if ($val2>$val4) { $val=$val2-$val4; @tempxy=grep(/$val\S/,@complex);print "\n ttt",$tempxy[0]; $tempxy[0]=chop($tempxy[0]);print "\n ttsfgsft=",$tempxy[0]; $tempxy[0]=$tempxy[0].$comparison;print "\n tttdjeo--=",$tempxy[0]; $calib2=$calib1.$tempxy[0]."1.1d"; } else{ if ($val1<$val3) {$val4=$val3-$val1;} elsif($val1>$val3) {$val4=24-$val1+$val3;} $val=$val2+$val4; @tempxy=grep(/$val\S/,@complex);print "\n ttt",$tempxy[0]; $tempxy[0]=chop($tempxy[0]);print "\n ttsfgsft=",$tempxy[0]; $tempxy[0]=$tempxy[0].$comparison;print "\n tttdjeo--=",$tempxy[0]; $calib2=$calib1.$tempxy[0]."1.1d"; } return ($calib2); } sub get_RAdiff_forsun{ local($jd,@daya_in_month,@avg_for_month;$RA,$change_in_jd,$shift_in_years,$comp,$value,$jd1,$jd2,$jd3,$jdtemp,$hourdiff,@arrcomp); @arrcomp=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w","24x"); $comp=$_[0]; $jdtemp=$_1; for ($ltemp=0;$ltemp<=8;$ltemp++) {chop($jdtemp);} $jd3=chop($jdtemp); $jd2=chop($jdtemp); $jd1=chop($jdtemp); $jd=$jd1.$jd2.$jd3; @days_in_month = (31,28,31,30,31,30,31,31,30,31,30,31); @avg_for_month = (254,234,220,225,236,247,240,225,216,223,244,254); #$jd = "244" . "$jd" if( $jd >= 9000 ); #$jd = "245" . "$jd" if( $jd < 9000 ); $RA = 67434.075 ; #right ascension of sun on 1st January,1995. $change_in_jd = $jd - 2449717.5; $shift_in_years = 0; if($change_in_jd >= 365 && $change_in_jd <= 730) { $shift_in_years = 1; $change_in_jd = $change_in_jd - 365; $RA = $RA - 60; $days_in_month1 = 29; } if($change_in_jd > 730) { $change_in_jd = $change_in_jd - 731; $shift_in_years = 2 + (int($change_in_jd / 365)); $change_in_jd = $change_in_jd % 365; $RA = $RA + 240 - ($shift_in_years * 60); } for($i=0;$i<12;$i++) { if($change_in_jd > $days_in_month$i) { $RA = ($RA + ($days_in_month$i*$avg_for_month$i)) % 86400; $change_in_jd = $change_in_jd - $days_in_month$i; } else { $RA = ($RA + ($avg_for_month$i*$change_in_jd)) % 86400; } } $value=(grep(/\d{1,2}$comp/,@comp))-0.5; if ($RA >$value) { $hourdiff=$RA-$value;} else{$hourdiff=$value-$RA;} return($hourdiff); }

Edit kudra, 2002-06-07 Removed formatting I added today, at jeffa's request. This node serves as an example of How (Not) To Ask A Question. It is an old node, so it doesn't harm the author that it isn't formatted.

Comment on find the syntax error!!!
RE: find the syntax error!!! (kudra: use the CODE tag)
by kudra (Vicar) on Jun 20, 2000 at 15:37 UTC
RE: find the syntax error!!!
by dempa (Friar) on Jun 20, 2000 at 15:42 UTC
RE: find the syntax error!!!
by redmist (Deacon) on Jun 20, 2000 at 16:01 UTC
    <pre> All that code. </pre>

    Also (if you are being serious), please be more specific; you could tell us what errors you are getting, what part of the code you suspect, etc.

    redmist
      Please use <code> and </code> tags rather then <pre> tags.

      But you are right that people should post the error as well as the code.

Re: find the syntax error!!!
by BUU (Prior) on Jun 07, 2002 at 03:45 UTC
    (Note, i reposted this in response to How (Not) To Ask A Question merely because i was curious as to what the code actually looked like)
    I am trying to run the following programme but the following errors ar +e being complained which I am not able to sort it out!!! syntax error at checkdataperl.p line 249, near "for" syntax error at checkdataperl.p line 250, near "++) " syntax error at checkdataperl.p line 286, near "}" Execution of checkdataperl.p aborted due to compilation errors. Dear Monks pls help me??? #!/usr/local/bin/perl print("\n \nWelcome !! Please input the response very carefully in thi +s programme whenever asked for \n Now please ensure that before running +the programme you have run the vp29apr programme for the corresponding hou +r and also the 1d files for the j or t hour as applicable are has also been +run upon \n Now please enter the hour for which you want to check the data quality (a,b,..x) \n?" ); $hour=;chop($hour); print("you entered ", $hour ,"\n"); $comparison=3;@arrone=();@arrtwo=(); @array=("o","p","q","r","s","u","v","w","x","a","b"); if ($hour eq "j") { $comparison=$hour; } elsif($hour eq "t") { $comparison=$hour; } else { for($n=0;$n<=10;$n++) { if($array[$n] eq $hour) { $comparison="t"; } } } if($comparison ne "t") { if($comparison ne $hour) { $comparison = "j"; } } print("\n the value of comparison is ", $comparison ,"\n"); print ("\n Please enter the allocation no. from which you want to chec +k the data (1-60) \n"); $allocin=;chop($allocin); print ("\n",$allocin,"\n"); use PGPLOT; # Load PGPLOT module print "\nTesting simple point plot...\n\n"; print "PGPLOT module version $PGPLOT::VERSION\n\n"; pgqinf("VERSION",$val,$len); print "PGPLOT $val library\n\n"; # "?" will prompt for device $dev = "/xw" unless defined $dev; pgbegin(0,$dev,1,1); # Open plot device pgscf(2); # Set character font pgslw(4); # Set line width pgsch(1.6); # Set character height #pgask(false); for ($alloc=$allocin;$alloc<=60;$alloc++) { print ("\n",$alloc,"\n"); $i=0;$m=0;$p=0; print "\n We are checking data quality for hour=$hour Alocation= $a +lloc \n"; $astatname="/tmp_mnt/usr4/mrt/vinayPandey/name".$alloc.$hour."1.astat" +; $onedname="/tmp_mnt/usr4/mrt/vinayPandey/name".$alloc.$hour."1.1d" ; if ($comparison ne $hour) { $caldet="/usr4/mrt/vinayPandey/caldet".$alloc.$comparison."1.1d"; open(CALDET,$caldet); $c2=0; $line=; while( $line ne "" ) {chop($line); ($calqone[$c2])=split(' ',$line,4); $line=; $c2++; } } if ((open(NAMEAS, $astatname)) && (open(NAMEONED,$onedname))) { while() { ($arrone[$i])=split(' '); $i++; } close(NAMEAS); $n[1]=$i-1; while() { ($arrthree[$m])=split(' '); $m++; } } $n[2]=$m-1; close(NAMEONED); $k=0; for($p=0;$p<=$n[1];$p++) { for($n=0;$n<=7;$n++) { chop($arrone[$p]); } $corresonedname=($arrone[$p]."astat.gz"; if ( -e $corresonedname ) { for($j=0; $j<=$n[2];$j++) { if ( $corresonedname eq $arrthree[$j]) { $arronestore[$p]; $arrtwostore[$p]; $arrthreestore[$j]; $arrfourstore[$j]; if (open(NAME ,"$corresonedname")) { $g=0; while() { # Read data in 2 columns from file handle # and put in two perl arrays chop(); ($y[$g]) = split(/\s+/); $g++; } print ("\ng=",$g,"\n"); close (NAME); } $response="h";$r="f";$ab1=0; while ($response ne "abcde") { @arrsidtime=("a","b","c","d","e","f","g","h","i", "j","k","l","m","n","o","p","q","r","s","t","u","v","w","x"); if ($r eq "f") { $y1=0;$y2=0.1;$fmin=$y[0]; for ($s1=0;$s1<($g-1);$s1++) { if ($fmax < $y[$s1]) { $fmax=$y[$s1]; } if ($fmin > $y[$s1]) { $fmin= $y[$s1]; } } print ("\n ymax=",$fmax,"Ymin=",$fmin,"\n"); $y1=$fmin; $y2=$fmax; $y2=($y2+0.1); $y1=($y1-0.1); print ("\n y2=",$y2,"y1=",$y1,"\n"); while( $hour ne $arrsidtime[$ab1]) { ++$ab1;$ab2=$ab1 + 1;$r="t"; } } pgenv($ab1,$ab2,$y1,$y2,0,0); # Define data limits and plot axes pglabel("X","Y",$corresonedname); # Labels pgsci(5); # Change colour pgline($g,\@x,\@y); print("\n please enter your response for the plot....\n FOR SEEING +THE PLOT WITH MODIFIED AXES PLEASE ENTER n \n OR GIVE THE APPROPRIA +TE QUALITY FACTOR FOR THE FILE FROM 1-9\n ?"); $response=; chop($response); print ("you entered ",$response,"\n"); if ($response eq "n" ) { print ("\n Please enter Xmin value\n"); $abr1=;chop($abr1); if ($abr1 ne "") {$ab1=$abr1;} print ("\n Please enter Xmax value\n"); $abr2=;chop($abr2); if ($abr2 ne "") {$ab2=$abr2;} print ("\n Please enter Ymin value\n"); $yr1=;chop($yr1); if ($yr1 ne "") {$y1=$yr1;} print ("\n Please enter Ymax value\n"); $yr2=;chop($yr2); if ($yr2 ne "") {$y2=$yr2;} } elsif(("123456789" =~ m/$response/) && ($response ne "")) { $quality[$k]=$response;$response="abcde"; print ("\n aulaity ",$k,"=",$quality[$k],"\n"); } else { print "\n please enter proper response\n"; } } if ($comparison eq $hour) { $k++; goto NEXTLINE; } else { $hdiffer = &get_RAdiff_fromsun($comparison,$arrthree[$k]); if (($quality eq "1") && ($hdiffer >= 2)) { $calfilename=&gencalfn($corresonedname,$comparison) if (-e $calfilename) { $c2=$c2-1; for($c3=0;$c3<=$c2;$c3=$c3++) { if(($calfilename eq $calqname[$c3]<=100)) { $gooddata="/usr4/mrt/vinayPandey/good".$hour; if (-e $gooddata) {open(FILE, ">>$gooddata"); } else { open(FILE,">$gooddata"); } $qnet=1; print FILE "$arrthreestore[$c3] $qnet \n"; close(FILE); $k++; goto NEXTLINE; } else { if ($calfilename eq $claname[$c3]) { $c2++; $k++; goto NEXTLINE; } } } } } $k++; goto NEXTLINE; } } } } else { print "\n we are not able to find file $corresonedname\n"; } NEXTLINE: } if ( $comparison eq $ hour) { print "\n +++ k= $k"; $k=$k-1;print "\n +++ k= $k"; $calname="/usr4/mrt/vinayPandey/caldet".$alloc.$hour."1.1d"; if (-e $calname) { open(CALNAME, ">>$calname"); } else { open(CALNAME, ">$calname"); } for($c1=0;$c1<=$k;$c1++) { $hdifference=&get_RAdiff_forsun($comparison,$arrthreestore[$c1]); if ($hdiffernce $c1]=$quality[$c1]+$W7; } print CALNAME "$arrthreestore[$c1] \n"; } close (CALNAME); } else { $k=$k-1; $c2=$c2-1; for($tak1=0;$tak1<=$k;$tak1++) { $calibname=&gencalfn($arrthree[$tak1],$comparison); $pos=&get_RAdiff_forsun($comparison,$arrthree[$tak1]); if (-e $calibname) {$W6=0;$factor="y";} else { $calibnamenew=$calibname; @newarr=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12 +l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w", +"24x"); for($st1=0;$st1<=6;$st1++) {chop($calibnamenew);} $b1=chop($calibnamenew); $b2=chop($calibnamenew); $b12=$b2.$b1; $jd1=chop($calibnamenew); $jd2=chop($calibnamenew); $jd3=chop($calibnamenew); $jday=$jd3.$jd2.$jd1; $nlm1=-1; $sn=chop($calibnamenew); $nl=0; while($nl != 5){ for ($ensure=1;$ensure<=2;$ensure++) {$nlm=$nlm1*$nl; $jday=$jday+$nlm; for ($na=1;$na<=4;$na++) { @subsubst=grep(/$na\S/,@newarr); $subsubst[0]); for ($nah=1;$nah<=24;$nah++) { @hoursubst=grep(/$nah\S/,@newarr); $hoursubst[0]); $caltestname=$calibnamenew.$subsubst[0].$comparison."1.1d"; if (-e $caltestname) { $calibname=$caltestname;$factor="y"; if ($nl=0) {$W6=0;} elsif($nl<=3) {$W6=3;} else{$W6=5;} goto CHECK; } } } if ($nl eq "0") {++$ensure;} } $nl++; } if ($factor ne "y") {$calibname=$calqone[$tak2];} CHECK: for ($tak2=0;$tak2<=$c2;$tak2++) { if ($calibname=$calqone[$tak2]) { if ($calqthree[$tak2]<=100){$W4=1;} elsif ($calqthree[$tak2]<=400){$W4=2;} else{$W4=3;} if ($arrtwostore[$k]<=100) {$W3=1;} elsif ($arrtwostore[$k]<=400) {$W3=2;} else {$W3=5;} if ($pos >= 4) { $W5=1; } elsif ($pos >= 2) { $W5=2; } else { $W5=5; } $netquality[[$tak2]+$W3+$W4+$W5+$W6; $calstoreone[$tak2]; $calstoretwo[$tak2]; $calstorethree[$tak2]; $calstorefour[$tak2]; goto FIRSTLOOP; } } } FIRSTLOOP: } print ("\n here the actual test starts i.e. comparison etc.....\n" ); } NEXTLINETWO: } LABELEND: pgend; print("\n this is the end of the programme\n"); sub gencalfn { local(@complex,$temp,$calib1,$val1,$val2,$tempx,$tempy,@tempxy,$val3,$ +calib2,$comparison,$val4); @complex=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12 +l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w", +"24x"); $calib1=$_[0]; $comparison=$_[1]; for ($temp=0;$temp<=3;$temp++) { chop($calib1); } $tempx=chop($calib1);print"\n $tempx==",$tempx; $tempy=chop($calib1);print"\n tempy==",$tempy; @val1=grep(/\d{1,2}$tempx/,@complex);print "\n val1==",$val1[0]; @val2=grep(/\d{1,2}$tempy/,@complex);print "\n val2==",$val2[0]; @val3=grep(/\d{1,2}$comparison/,@complex);;print "\n val3==",$val3[0]; chop($val1[0]);print "\n ",$val1[0]; if ($val1 $val3) {$val4=$val1-$val3;} if ($val2>$val4) { $val=$val2-$val4; @tempxy=grep(/$val\S/,@complex);print "\n ttt",$tempxy[0]; $tempxy[0]; $tempxy[0]; $calib2=$calib1.$tempxy[0]."1.1d"; } else{ if ($val1<$val3) {$val4=$val3-$val1;} elsif($val1>$val3) {$val4=24-$val1+$val3;} $val=$val2+$val4; @tempxy=grep(/$val\S/,@complex);print "\n ttt",$tempxy[0]; $tempxy[0]; $tempxy[0]; $calib2=$calib1.$tempxy[0]."1.1d"; } return ($calib2); } sub get_RAdiff_forsun{ local($jd,@daya_in_month,@avg_for_month;$RA,$change_in_jd,$shift_in_ye +ars,$comp,$value,$jd1,$jd2,$jd3,$jdtemp,$hourdiff,@arrcomp); @arrcomp=("1a","2b","3c","4d","5e","6f","7g","8h","9i","10j","11k","12 +l","13m","14n","15o","16p","17q","18r","19s","20t","21u","22v","23w", +"24x"); $comp=$_[0]; $jdtemp=$_[1]; for ($ltemp=0;$ltemp<=8;$ltemp++) {chop($jdtemp);} $jd3=chop($jdtemp); $jd2=chop($jdtemp); $jd1=chop($jdtemp); $jd=$jd1.$jd2.$jd3; @days_in_month = (31,28,31,30,31,30,31,31,30,31,30,31); @avg_for_month = (254,234,220,225,236,247,240,225,216,223,244,254) +; #$jd = "244" . "$jd" if( $jd >= 9000 ); #$jd = "245" . "$jd" if( $jd = 365 && $change_in_jd <= 730) { $shift_in_years = 1; $change_in_jd = $change_in_jd - 365; $RA = $RA - 60; $days_in_month[1] = 29; } if($change_in_jd > 730) { $change_in_jd = $change_in_jd - 731; $shift_in_years = 2 + (int($change_in_jd / 365)); $change_in_jd = $change_in_jd % 365; $RA = $RA + 240 - ($shift_in_years * 60); } for($i=0;$i $days_in_month[$i]) { $RA = ($RA + ($days_in_month[$i])) % 86400; $change_in_jd = $change_in_jd - $days_in_month[$i]; } else { $RA = ($RA + ($avg_for_month[$i]*$change_in_jd)) % 86400; } } $value=(grep(/\d{1,2}$comp/,@comp))-0.5; if ($RA >$value) { $hourdiff=$RA-$value;} else{$hourdiff=$value-$RA;} return($hourdiff); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://18974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-09-15 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls