in reply to Pascal's triangle...
#!/usr/bin/perl -wl sub pascal { while (s/\d+(?= (\d+))/$&+$1/eg < shift) { s/^/1 /; print; } } [download]