In Reply To:
I think that the reason it is displaying the code instead of executing it is because you have a space before sub.
so it should be "sub { whatever }" not " sub {whatever}".
I already spotted that one... I will keep fiddling with it and see if I can work out what is wrong.
Cheers.