script error, help!!!
I am trying to display my records from an oracle database with the code section below:
while(@row=$sth->fetchrow_array)
{
($fac,$dept,$deg,$major,$credits)=@row;
print "<tr>";
print "<td>$fac</td>";
print "<td>$dept</td>";
print "<td>$deg</td>";
print "<td>$major</td>";
print "<td>$credits</td>"; #line 30
print "</tr>\n";
}
but i always get an error that says 'Use of uninitialized value in concatenation (.) or string at status.cgi line 30.'
what must i do to solve this and get the results printed out?? I've been trying for quite long and nothing works, please help!!!
Try this
hmmmmmmmmmmm sorry my example was poor...didnt know what i was on about lol
Last edited by Scriptage; 05-08-2003 at 09:19 AM .
print "<td>".$credits."</td>";
This and what the original poster had do the exact same thing.
Casy, the error you're getting is because the value for the variable $credits is undef . You'll need to have it default to an empty string instead of the undefined value.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
lol sorry
<------------noob
But...I'm confused.......How can undef make a concatenation error????????? If it's undef then it just prints nothing!!!
Try
#!/usr/bin/perl
$value = undef;
print "$value";
output: " " <-----------nothing
!!!????!!!????
Last edited by Scriptage; 05-08-2003 at 09:25 AM .
Now try it with warnings enabled, which they always should be.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
yeah,
use of uninitialised value in string
not in concactenation!!!!!!!!!!!!!
It is a concactenation error, which means perl is finding a . somewhere..... probably in $credits dont you think
lol
Your example doesn't mention concatentation because you havn't concatenated anything. Replace with this line and see.
Code:
print "foo $value";
which means perl is finding a . somewhere..... probably in $credits dont you think
Don't confuse variable interpolation with eval ing. A period occuring in an interpolated string will not be interpreted as a concatenation operator.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
im on about the original posters example read it!!!
im on about the original posters example read it!!!
I have read it. And I've answered it. And I've answered you. I'm not sure what you don't understand anymore.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
she said she got an error saying concactenation error, an undef variable does not produce a concatenation error!
an undef variable does not produce a concatenation error
It does if warnings are enabled. So... (a very mild amount of deductive thinking required here) the original poster must have warnings enabled.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
no..it says use of unitialised value!!!!!!!!!!!!!!!!!1 not concactenation!!!!!!!!!!!!!! FFS
The original poster's, or your example. Because the error message posted by the OP does say concatenation.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
The original poster says she gets a concatenation error.....you say it is because a variable is undef. However....if you try my example you will find that an undef variable produces the error "use of unitialised value" not "concactenation".
Understand???
....if you try my example you will find that an undef variable produces the error "use of unitialised value" not "concactenation".
Understand???
Yes, I do understand. I understood 8 posts ago where I already told you why.
for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
{for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks