in reply to Cant figure out this part?

Just some further explanation for you. 'cb' stands for 'callback' - pass subroutine foo subroutine bar and call foo within bar. Here is a silly example to meditate on:
use strict; sub decorate { my ($cb,$text) = @_; return $cb->($text); } my %sub = ( bold => sub { return '<b>' . shift() . '</b>' }, ital => sub { return '<i>' . shift() . '</i>' }, undl => sub { return '<u>' . shift() . '</u>' }, ); for (keys %sub) { print decorate($sub{$_},'foobar'), "\n"; }
Here is a decent explanation of callbacks, the tutorial is really about Gtk. Callbacks are used extensively in GUI programming. The idea is to assign a subroutine to a widget such as a button. When the user clicks that button, the button calls the subroutine that was assigned to it. This allows the GUI programmer to easily add functionality.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)