What I'm specifically referring to is form generation. The rest of the HTML generating methods are useless to me (like the h1() method), but I'll focus on the cool form generating ones.
Why are they cool? They simplify your life and make code cleaner - For instance, lets say oyu have this fugly line of code:
$poop = "email_address";
$default = "user@somedomain.com"
print 'Email address: <input type="text" name="' . $poop .
'" value="' . $default . '"><br>';
This prints out happy html that looks like this:
Email address:
Now, that print line is pretty damn ugly, but we can easily make it pretty once more by doing:
use CGI qw/:standard/; print "Email Address: " . textfield($poop, $default) . "<br>";
And the output is:
Email Address:
Neat? Yeah.. What next? More neatness! You have an array you want to turn into a group of checkboxes...
use CGI qw/:standard/;
@foo = ("check1", "foo", "bar", "baz", "poopie", "hello", "Coke!", "Pepsi?");
@def = ("foo", "bar", "poopie");
print 'Checkbox listing:<br>';
print checkbox_group(-name => "options", -values => \@foo,
-columns => 3, -defaults => \@def);
print '<br>';
What does this look like?
Checkbox listing:
| check1 | baz | Coke! |
| foo | poopie | Pepsi? |
| bar | hello |