in reply to File upload and regex
1> changing three lines of code to use an array
-or-# ...snip... my @cases; # make this an array # ...snip... foreach(@goods){ if (s/$caseid//){ push @cases, $_; # add caseid to array } } # ...snip... print h2('Cases'), "@cases"; # print the cases # ...snip...
2> changing one line of code to append to the string
# ...snip... my $cases; # keep this as an empty string # ...snip... foreach(@goods){ if (s/$caseid//){ $cases .= $_ . ' '; # append caseid to string } } # ...snip... print h2('Cases'), $cases; # print the cases # ...snip...
~Particle ;Þ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: File upload and regex
by amearse (Sexton) on Mar 05, 2002 at 22:02 UTC |