I have a folder "items" under which I have files like: fruit and animal containing the names of fruits and animals respectively. Now I want to use optgroup select option.
Can anyone please suggest me what went wrong. Many thanks in advance !!#!/usr/bin/perl print "Content-Type: text/html\n\n"; my @filename = split("\n", `ls items`); print <<HTML <html> <body> <select> HTML foreach(@filename){ print <<HTML <optgroup label="$_"> HTML open my $info, "items/$_" or die "Could not open $_: $!"; while( my $line = <$info>) { print <<HTML <option value="$line">$line</option> HTML } } print <<HTML </optgroup> </select> </body> </html> HTML
Regards, Alok
In reply to optgroup with Perl CGI by alokranjan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |