- 论坛徽章:
- 0
|
- sub Create_ID_File {
-
- my ($id, $TL_File, $TL_H_File) = @_;
- my $Input_Line;
- my $Iterator_I=0;
- my $Iterator_J=0;
- my @Id_Array = ();
-
- # Get id
- @Id_Array=split(",",$id);
- @Id_Array=sort { $a <=> $b } @Id_Array;
-
- unless(open(TL_H_File, "< $TL_H_File")) {
- print STDERR "Failed to open $TL_H_File";
- return API_FAIL;
- }
-
- if (-e $TL_File) {
- unlink $TL_File;
- }
-
- unless(open(TL, "> $TL_File")) {
- print STDERR "Failed to open $TL_File";
- return API_FAIL;
- }
-
- $Iterator_I=0;
- $Iterator_J=0;
- while ( $Input_Line = <TL_H_File> ) {
- chomp $Input_Line;
- if ($Input_Line =~ m/\s*\'cmdline\'\s*=>\s*\'(.*)\',$/) {
- if ($Iterator_I == $Id_Array[$Iterator_J]) {
- print TL "TEST = $1\n";
- # 如果我有下面这行,那就会有警告,如果注销下面这行,就没有。。。
- $Iterator_J++;
- }
- $Iterator_I++;
- }
- }
-
- close(TL_H_File);
- close(TL);
-
- return API_SUCCESS;
- }
复制代码 警告就是:
Use of uninitialized value in numeric eq (==) at log.pl line 381, <TL_H_File> line 79.
Use of uninitialized value in numeric eq (==) at log.pl line 381, <TL_H_File> line 87.
Use of uninitialized value in numeric eq (==) at log.pl line 381, <TL_H_File> line 95.
Use of uninitialized value in numeric eq (==) at log.pl line 381, <TL_H_File> line 103.
.... (很多很多,每个匹配 m/\s*\'cmdline\'\s*=>\s*\'(.*)\',$/到行都会报这个警告)
381行是: if ($Iterator_I == $Id_Array[$Iterator_J]) {
请大家帮忙,谢谢! |
|