in reply to 'or' Bug Bear

use strict at the beginning of the script! It should tell you that you haven't declared the variable $fred...

And you should invoke the subroutine like fred()