6 May
2003
6 May
'03
09:40
On Tuesday 06 May 2003 9:25 am, Dug Stokes wrote:
Hi!
Has anyone got five minutes to spare to be able to tell me how to get a list of files in the current directory with <option></option> around each file?
So far I've written;
print "<select name=file><option>";
print `ls\n`;
print "</option></select>";
But naturally, I need the <option> bit around each filename!
Please help!
Dug Stokes
My Perl is a little rusty, to coin a phrase, but what about: #!/usr/bin/perl -w print "<select name=file>\n"; while (<>) { print "<option>$_</option>\n"; } print "</select>\n"; and invoke it with ls -bA | ./t.pl (works for me) cheers timp