473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

very strange conditional failure

I just finished debugging a very strange problem, and was wondering if
any of you had ever seen it before. My code is very long, so I will only
post the interesting parts.

ok, so using DBD::Sybase and some other stuff, we do a select query on a
database and store the return like this:

#####------######

$sql = "SELECT blah blah blah";

$sth = $dbh->prepare();

$sth->execute();

while (my $equip_row = $sth->fetchrow_arrayref()){

# ....

# this line prints $equip_row->[16] is (so**@email.address)\n
# which is right
print "\$equip_row->[16] is ($equip_row->[16])\n";

if ($equip_row->[16] != undef){ # But then this test fails

# and this line doesn't print at all
print "$equip_row->[16] is not undef, so...\n";

# sends email
# ....

}
}
#####------######

Now if I change the line where the conditional is to

if ($equip_row->[16] =~ /\S+/) {

It works. Both debug lines print like they should and the emails get sent.

The code is working now, because I left it as a regex test, but this is
the craziest thing I've ever seen. I looked at it for hours, and I don't
think I'm missing anything stupid.

Anyone else have any ideas ?

--
Michael O'Malley Jr.
President
Pillar Open Source.
Jul 19 '05 #1
0 1121

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: joe | last post by:
I am having problems checking for the value of an XMLDOM object . Lets say my XMLDOM object was successfully created as objXMLDoc, and that has several nodes on it. In the case of a VBScript loop...
28
by: Benjamin Niemann | last post by:
Hello, I've been just investigating IE conditional comments - hiding things from non-IE/Win browsers is easy, but I wanted to know, if it's possible to hide code from IE/Win browsers. I found...
8
by: Noah Roberts | last post by:
There is some windows specific code in this, but I believe the issue to be something standard so... The problem is that after attaching the name of the subdirectory I have something like...
1
by: Sam Kong | last post by:
Hello! Recently I had a strange problem with Visual C# 2005 beta 1. When I ran(F5 key) a program, <#if DEBUG> statement was not working. It ran as RELEASE mode. So I had to manually define...
11
by: wASP | last post by:
Hi, I've got a pair of int properties in a class. The properties in question are indexing values - but that's not relevant to my problem - or it's just symptomatic ... sort of. They are...
0
by: Benman | last post by:
Hi everyone, I was looking for a way to execute an .ASP page through the windows scehduler, and I found several posts that showed out to "run" a URL using a windows scripting file. The file...
12
by: John | last post by:
I can't get my head around this! I have the following code: <% .... Code for connection to the database ... .... Code for retrieving recordset ... If Not rs.EOF Then ... Do something...
5
by: paulo | last post by:
Can anyone please tell me how the C language interprets the following code: #include <stdio.h> int main(void) { int a = 1; int b = 10; int x = 3;
2
by: Lyn | last post by:
Hi, Having fun trying to get Conditional Formatting working on a textbox control in a continuous form subform (Access 2003). The condition I want is when the value of the textbox is Null and/or...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.