in reply to Lists

open(DATA,'file') or die $!; print "<SELECT NAME=foo>"; while(<DATA>) { chomp; print "<OPTION>$_</OPTION>\n"; } print "</SELECT>"; close DATA;
that'll read the file, strip the newline, and put each line as an option in the select box.
                - Ant

Replies are listed 'Best First'.
Re: Re: Lists
by arturo (Vicar) on Apr 17, 2001 at 19:54 UTC

    Or, using the handy function in CGI.pm,

    use CGI qw(:standard); # stuff open FILE, $filename or die "Can't open $filename: $!\n"; my @lines = <FILE>; chomp @lines; close FILE; # more stuff print scrolling_list(-name=>'foo', -values=>\@lines);

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor