Skip to content

Instantly share code, notes, and snippets.

@vicmortelmans
Created June 24, 2011 10:29
Show Gist options
  • Save vicmortelmans/1044552 to your computer and use it in GitHub Desktop.
Save vicmortelmans/1044552 to your computer and use it in GitHub Desktop.
Perl script that transforms a list of strings into an HTML select element
#!/usr/bin/perl
use HTML::Entities;
print "<select>\n";
while (<STDIN>) {
chop;
$s = encode_entities($_);
print "<option value=\"$s\">$s</option>\n";
}
print "</select>\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment