You could do something like
@files=`ls`; # no '\n' needed print "<select name=file>\n"; # note I've moved the <option> foreach(@files) { print "<option>$_</option>\n"; } print "</select>";
but for portability it's better to use perl functions - that way, for example the same perl code would work on a windows box. Try something like:
print "<select name=file>\n"; # note I've moved the <option> print "<option>$_</option>\n" while (<*>); print "</select>";
Yes, Gary :) A "globbing" pattern such as "<*>" is how one *should* open files in perl, anyway :) -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com __________________________________________________ Yahoo! Plus For a better Internet experience http://www.yahoo.co.uk/btoffer