Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print misbehaving????

Status
Not open for further replies.

webamoeba

Programmer
Sep 6, 2006
23
GB
Hi,

I'm having some problems with the print function in perl when running through Apache.

The following works:

print qq[
test];

the following do not work:

print qq[test];
print "test";
print 'test';

But all of them work when running from the bash i.e. Perl someFile.pl
what the????? does any1 know why???

Thanks.
 
nothing wrong with the print functions you posted, lets see the script you are using that is having problems.
 
Your going to be throughly disappointed by this :) lol

#!/usr/bin/perl5.8.3

print q[
test];

or

#!/usr/bin/perl5.8.3

print q[test];

or

#!/usr/bin/perl5.8.3

print "test";

#!/usr/bin/perl5.8.3

print 'test';
 
are you running this through a web browser?

Code:
#!/usr/bin/perl5.8.3
# make sure the above is the correct shebang line
 
#print an http header first
print "Content-type: text/html\n\n";

#now print anything else
print q[
test];

check the apache error logs to see what error your scripts generate.
 
Hooray!!!!

Thankyou! yup it all seems to be working quite happily now. Sorry for the dumb question... oopsie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top