Hi, 

I am a beginner in writing Perl-cgi scripts, and hope you can help me
with the following problem. I have been writing a script that uses
the Unix "grep" function to search for a word posted to the script from
a web form, and return the search results to a web page.

The script works well, but I am not satisfied with the layout of the
returned website. When typing the grep command in a Unix terminal I
get the results nicely lined up under eachother, i.e. one file per
line, like this :

Testfile1
Testfile2
....

However, when printing to the web page, the resulting files are printed
next to eachother, only separated by a blank space, like this:

Testfile1 Testfile2 ...


The essence of the code is as follows : 

> $testvalue=$value[0];
> $word = `grep -inlsh $testvalue *`;
> print "The string $testvalue was found in these files : <p>$word</p>";


Thus, what I need is a procedure that splitsthe parameter word, which stores
the result as a vector of filenames, into separate values. I image I must
use some kind of for-loop to do this, but exactly how I do not know...

Any help would be greatly appreciated!

Sincerely,
Ted


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to