|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi all...
I am making a CGI that runs this... #!/usr/bin/perl use DBI; . . . while (my $hash_ref=$sth->fetchrow_hashref()) { print"$hash_ref->{name} and $hash_ref->{age}n" } this worked perfectly on terminal window... >PERL MYCGI.CGI but when i tried trough HTTP, it only prints "and"... WHY? Thanks... landim2@brhs.com.br |
|
#2
|
|||
|
|||
|
I'm not sure why it acts like that because I never reference my hashes like that, but I'd figure the '->' reference is being parsed by the browser as a tag error. Try:
Code:
print $hash->{name} . " and " . $hash->{age};
or my favorite Code:
print "$hash{name} and $hash->{age}";
Also if your working on a remote web server make sure you're connecting to the right data base. I'm sure you've already figured this out but I thought I might give it a guess anyway. Later, t |
|
#3
|
|||
|
|||
|
check your code for the CGI part. It may be that your variables are not being passed to the script properly or that you are not passing them back from the script to the browser properly. Also, I don't see a 'use CGI;' at the top of your script or any other code indicative of a CGI script. You may have to check that. Next time, you may want to include more code to get a more specific answer.
Hope this helps.
__________________
- dsb - ![]() Perl Guy |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Perl only Prints on Terminal Window |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|