I had the same problem. Every time I tried to run ubb6_test.cgi, hello.pl, hello.cgi, or even ubb_ubgrade.cgi I'd get "command not found". The only way I was able to get this to work is by and '-w' to the perl line.
#!/usr/bin/perl -w
I ended up having to add this to all the cgi files to get ubb to work.