I’ve installed WP-Syntax, a great plugin for WordPress that lets you add code snippets to your blog posts without losing all the formatting.
You can use all manner of languages and even include line numbers if you want. Here’s a snippet from one of my math worksheet makers written in Perl:
use List::Util shuffle; # Use the Shuffle module
# define and populate the arrays
my @girlsnames = ('Erin','Anna','Joanne','Sally', 'Mary');
my @boysnames = ('Adam','Ken','Tom','Paul','David', 'Sam');
@girlsnames = shuffle @girlsnames; # shuffle the girls' array
@boysnames = shuffle @boysnames; # shuffle the boys' array
$name1 = pop(@boysnames); # assign last name in array to $name1;
$name2 = pop(@girlsnames); # assign last name in array to $name2;
If you have a comment, find me on Twitter at @longcountdown
. I'd love to hear from you!