in reply to File upload and regex

there are two ways to fix this.

1> changing three lines of code to use an array

# ...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...
-or-

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
    Big thanks to particle and grep. I just needed a little push.