Actually we don't know WHAT the p is (of course, we're assuming he's using CGI.pm, but who knows :-) . It might be a function, it might be a filehandle, it might be undefined.
And perl behaves differently depending on what it is. Comment out the glob assignment, then the sub, then both, then neither in the following (and uncomment them both and switch 'em around):
#!/usr/local/bin/perl
#sub p {
# return "bob\n";
#}
*p=\*STDOUT;
print p ("hello\n");
Update: Oops, sorry damian, I wasn't keeping track of who was replying to who :-)