Perl 板


LINE

#计算Net值的关键条件是在下面的Printf有$net那段才对 #谢谢 herculus6502 的提醒,Perl新手第3天上路 #起码有正确的方向修改了,公司没人会Perl = = 惨 my ( $hmax, $hmin, $fg, $cnt ) = ( undef, undef, 0, 0 ); $hmax->{value} = 0.001; $hmin->{value} = 999.999; $hmax->{ordno} = 'XXXXX'; $hmin->{ordno} = 'ZZZZZ'; $cnt = 0; my $ggg = undef; my $hms = undef; $hms->{gt30} = 0; $hms->{28_30} = 0; $hms->{26_28} = 0; $hms->{24_26} = 0; $hms->{22_24} = 0; $hms->{20_22} = 0; $hms->{19_20} = 0; $hms->{18_19} = 0; $hms->{17_18} = 0; $hms->{16_17} = 0; $hms->{15_16} = 0; $hms->{14_15} = 0; $hms->{13_14} = 0; $hms->{12_13} = 0; $hms->{11_12} = 0; $hms->{10_11} = 0; $hms->{lt10} = 0; my $ssum_ms = 0; my @lkey = keys %$buf; @lkey = sort @lkey; my $lmax = scalar( @lkey ); for ( my $i =0 ;$i< $lmax; $i++ ) { my $key = $lkey[$i]; if ( (!defined $buf->{$key}{RR}{ms}) || $buf->{$key}{RR}{ms} eq '' ) { printf("%s, %s => %s (UNKNOW)\n", $key, $buf->{$key}{SS}{tp}, '??:??:??.???' ); } else { my $net = $buf->{$key}{RR}{ms} - $buf->{$key}{SS}{ms}; $ssum_ms += $net; if ( $net > $hmax->{value} ) { $hmax->{value} = $net; $hmax->{ordno} = $key; } if ( $net < $hmin->{value} ) { $hmin->{value} = $net; $hmin->{ordno} = $key; } if ( $net >= myLimit ) { $ggg->{$key} = $net; } if ( $net > 30 ) { $hms->{gt30} += 1; } elsif ( $net > 28 ) { $hms->{28_30} += 1; } elsif ( $net > 26 ) { $hms->{26_28} += 1; } elsif ( $net > 24 ) { $hms->{24_26} += 1; } elsif ( $net > 22 ) { $hms->{22_24} += 1; } elsif ( $net > 20 ) { $hms->{20_22} += 1; } elsif ( $net > 19 ) { $hms->{19_20} += 1; } elsif ( $net > 18 ) { $hms->{18_19} += 1; } elsif ( $net > 17 ) { $hms->{17_18} += 1; } elsif ( $net > 16 ) { $hms->{16_17} += 1; } elsif ( $net > 15 ) { $hms->{15_16} += 1; } elsif ( $net > 14 ) { $hms->{14_15} += 1; } elsif ( $net > 13 ) { $hms->{13_14} += 1; } elsif ( $net > 12 ) { $hms->{12_13} += 1; } elsif ( $net > 11 ) { $hms->{11_12} += 1; } elsif ( $net > 10 ) { $hms->{10_11} += 1; } else { $hms->{lt10} += 1; } #看来关键条件是在这边才对 printf("%s, %s => %s (%6d)\n", $key, $buf->{$key}{SS}{tp}, $buf->{$key}{RR}{tp} , $net ); $cnt++; } } print '-' x 80;print "\n"; printf ("MAX: %s (%.3f)\n", $hmax->{ordno}, $hmax->{value} ); printf ("MIN: %s (%.3f)\n", $hmin->{ordno}, $hmin->{value} ); --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.63.31.120







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Gossiping站内搜寻

TOP