freelanceprogrammers.org Forum Index » Perl
Perl error "Split Loop"
Joined: 20 Dec 2005
Posts: 1
Perl error "Split Loop"
I am running Red Hat Linux 9 2.4.20-31.9.
My perl version is 5.8.0
Here is the error that I am getting "Split loop at ./cf3p_watch.pl
line 29."
This script works on my solaris 8 box with no errors, it is only when I
tried migrating the script over to linux that it received this error.
Here is my code...
#!/usr/bin/perl
$p1="/home/jkay/scripts";
$p2="/home/jkay/log";
$ctm1=4.42;
$ctm2=11.91;
$ctm3=20.13;
$ctm4=28.72;
$ctm5=37.52;
$h=`date +\%H`;chomp $h;
$m=`date +\%M`;chomp $m;
$dt=`date +\%y%m%d`;chomp $dt;
$w=`date +\%w`;chomp $w;
#################################
###### Kentwood #################
#################################
open(LOG,">>$p2/cf3p_kw_watch.csv") || die;
@cf3p=`$p1/cf3p_kw.exp`;
chomp @cf3p;
$sw="KW";
$size=@cf3p;
for($x=0;$x<$size;$x++) {
while($cf3p[$x]!~m/START:[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/)
{
$x++;
}
@word=split(/s/,$cf3p[$x]);
$tstamp=substr($word[0],-10)." ".$word[1];
while($cf3p[$x]!~m/CF3P/) {
$x++;
}
$x++;
$members=$cf3p[$x];
grep s/s+//,$members;
grep s/ //,$members;
$x++;
@word=split(/s+/,$cf3p[$x]);
$x++;
@word1=split(/s+/,$cf3p[$x]);
$cnfszrs=$word[1];
$cnfovfl=$word[2];
$cnfqocc=$word[3];
$cnfqovfl=$word[4];
$cnfqaban=$word1[1];
$cnftru=$word1[2];
$cnfsbu=$word1[3];
$cnfmbu=$word1[4];
$conf_att=($cnfovfl-$cnqovfl)+$cnfszrs;
$conf_erl=sprintf("%3.2f",($cnftru*10)/1800);
$conf_aht=sprintf("%3.2f",$conf_erl/$cnfszrs);
$conf_ovf=$cnfovfl;
grep s/
//,$conf_att;
grep s/
//,$conf_erl;
grep s/
//,$conf_aht;
grep s/
//,$conf_ovf;
if($members==10) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm1)*100);
} elsif ($members==20) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm2)*100);
} elsif ($members==30) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm3)*100);
} elsif ($members==40) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm4)*100);
} elsif ($members==50) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm5)*100);
}
print LOG
"$tstamp,$sw,$members,$conf_att,$conf_ovf,$conf_erl,$conf_aht,$conf_util
";
"$tstamp,$sw,$members,$conf_att,$conf_ovf,$conf_erl,$conf_aht,$conf_util
";
while($x<$size) {
$x++;
}
}
close(LOG);
#################################
###### Davenport ################
#################################
open(LOG,">>$p2/cf3p_dav_watch.csv") || die;
@cf3p=`$p1/cf3p_dav.exp`;
chomp @cf3p;
$sw="DV";
$size=@cf3p;
for($x=0;$x<$size;$x++) {
while($cf3p[$x]!~m/START:[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]/)
{
$x++;
}
@word=split(/s/,$cf3p[$x]);
$tstamp=substr($word[0],-10)." ".$word[1];
while($cf3p[$x]!~m/CF3P/) {
$x++;
}
$x++;
$members=$cf3p[$x];
grep s/s+//,$members;
grep s/ //,$members;
$x++;
@word=split(/s+/,$cf3p[$x]);
$x++;
@word1=split(/s+/,$cf3p[$x]);
$cnfszrs=$word[1];
$cnfovfl=$word[2];
$cnfqocc=$word[3];
$cnfqovfl=$word[4];
$cnfqaban=$word1[1];
$cnftru=$word1[2];
$cnfsbu=$word1[3];
$cnfmbu=$word1[4];
$conf_att=($cnfovfl-$cnqovfl)+$cnfszrs;
$conf_erl=sprintf("%3.2f",($cnftru*10)/1800);
$conf_aht=sprintf("%3.2f",$conf_erl/$cnfszrs);
$conf_ovf=$cnfovfl;
if($members==10) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm1)*100);
} elsif ($members==20) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm2)*100);
} elsif ($members==30) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm3)*100);
} elsif ($members==40) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm4)*100);
} elsif ($members==50) {
$conf_util=sprintf("%3.2f",($conf_erl/$ctm5)*100);
}
print LOG
"$tstamp,$sw,$members,$conf_att,$conf_ovf,$conf_erl,$conf_aht,$conf_util
";
"$tstamp,$sw,$members,$conf_att,$conf_ovf,$conf_erl,$conf_aht,$conf_util
";
while($x<$size) {
$x++;
}
}
close(LOG);
if($w==0 && $h==01 && $m<30) {
system("uuencode $p2/cf3p_kw_watch.csv cf3p_kw_watch_$dt.csv |
/usr/lib/sendmail jkay@ilpcs.com");
system("rm $p2/cf3p_kw_watch.csv");
open(NEW,">$p2/cf3p_kw_watch.csv") || die;
print NEW
"TSTAMP,SWITCH,MEMBERS,ATTEMPTS,OVERFLOWS,ERLANGS,AHT,UTILIZATION
";
close(NEW);
system("uuencode $p2/cf3p_dav_watch.csv cf3p_dav_watch_$dt.csv
| /usr/lib/sendmail jkay@ilpcs.com");
system("rm $p2/cf3p_dav_watch.csv");
open(NEW,">$p2/cf3p_dav_watch.csv") || die;
print NEW
"TSTAMP,SWITCH,MEMBERS,ATTEMPTS,OVERFLOWS,ERLANGS,AHT,UTILIZATION
";
close(NEW);
}
[Non-text portions of this message have been removed]
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







