ahhlun has asked for the wisdom of the Perl Monks concerning the following question:
44 sub constructList($release, $daily_test) { 45-52 Logic to handle getting a HTML page 53 if ($res->is_success) { 54 my @tokens = split('\n',$res->as_string); 55 my @List = (); 56 57 if($daily_test == "daily"){ 58 foreach my $token (@tokens){ 59 if($token =~ m/HREF="([a][^\/]*)/i) { 60 my $extracted = $1; 61 if ($1 !~ m/win/i){next;} 62 if (addDaily($extracted) == 1) { 63 push(@List, $extracted); 64 } 65 } 66 67 } #end foreach 68 69 } #end if 70 71 elsif ($daily_test == "test"){ 72 my $atLeastOneMatch = 0; 73 foreach my $token (@tokens){ 74 if($token =~ m/HREF="([a][^\/]*)/i) { 75 my $extracted = $1; 76 if ($1 !~ m/win/i){next;} 77 if(addTest($extracted) == 1){ 78 push(@List, $extracted); 79 } 80 } 82 } #end foreach
Thanks!58 foreach my $token (@tokens){ 59 if($token =~ m/HREF="([a][^\/]*)/i) { 60 my $extracted = $1; 61 if ($1 !~ m/win/i){next;} 57 if($daily_test == "daily"){ 62 if (addDaily($extracted) == 1) { } elsif($daily_test == "test"){ 62 if (addTest($extracted) == 1) { } 63 push(@buildList, $extracted); 64 } 65 } 66 67 } #end foreach
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to write good code?
by moritz (Cardinal) on Jun 16, 2009 at 15:21 UTC | |
|
Re: How to write good code?
by jdporter (Paladin) on Jun 16, 2009 at 17:05 UTC | |
|
Re: How to write good code?
by ELISHEVA (Prior) on Jun 16, 2009 at 17:34 UTC | |
|
Re: How to write good code?
by eyepopslikeamosquito (Archbishop) on Jun 16, 2009 at 22:02 UTC | |
by ahhlun (Novice) on Jun 19, 2009 at 19:46 UTC | |
|
Re: How to write good code?
by toolic (Bishop) on Jun 16, 2009 at 15:55 UTC | |
|
Re: How to write good code?
by Limbic~Region (Chancellor) on Jun 16, 2009 at 17:58 UTC |