U
usenet
I'm beginning to think my Perl has gone crazy with the way it uses
modules. First, the strange situation that I posted on
http://tinyurl.com/8zvet (sorry, I'm behind a corporate firewall and
I'm stuck with Google:80 for Usenet).
Now I'm doing a bit of database stuff. Consider this simple example:
#!/usr/bin/perl -w
use DBIx::Simple;
use strict;
my $dbh = DBIx::Simple -> connect("dbiB2:testdb2", 'userid', 'pw');
my $sql = "select TS_LOAD from TESTDB2.SUPLMODL order by TS_LOAD";
my $sql_timestamp = '2005-06-03 09.36.41.849402'; #ie, 26-byte DB2
my @bar = $dbh -> query($sql) -> flat();
foreach my $foo(@bar) {
if ($foo eq $sql_timestamp) {
print "'$foo'\n'$sql_timestamp'\n"; #for diagnostic
}
}
The "if" condition will never evaluate true. However, if I change it:
if ($foo =~ /^$sql_timestamp$/) {
then it will work! The diagnostic "print" stmt says (as expected):
'2005-06-03 09:36:41.849402'
'2005-06-03 09.36.41.849402'
THIS IS INSANE. The statement:
if ($foo eq $sql_timestamp) {
should be functionally IDENTICAL to
if ($foo =~ /^$sql_timestamp$/) {
RIGHT?????
Perl seems to have gone completely crazy!
Does anyone have ANY idea what could possibly be going on here? This is
driving me nuts.
I'm using Perl 5.8.4 built for AIX 5.1MR2. DBIx::Simple is 1.26, FWIW.
Thanks for looking!
modules. First, the strange situation that I posted on
http://tinyurl.com/8zvet (sorry, I'm behind a corporate firewall and
I'm stuck with Google:80 for Usenet).
Now I'm doing a bit of database stuff. Consider this simple example:
#!/usr/bin/perl -w
use DBIx::Simple;
use strict;
my $dbh = DBIx::Simple -> connect("dbiB2:testdb2", 'userid', 'pw');
my $sql = "select TS_LOAD from TESTDB2.SUPLMODL order by TS_LOAD";
my $sql_timestamp = '2005-06-03 09.36.41.849402'; #ie, 26-byte DB2
my @bar = $dbh -> query($sql) -> flat();
foreach my $foo(@bar) {
if ($foo eq $sql_timestamp) {
print "'$foo'\n'$sql_timestamp'\n"; #for diagnostic
}
}
The "if" condition will never evaluate true. However, if I change it:
if ($foo =~ /^$sql_timestamp$/) {
then it will work! The diagnostic "print" stmt says (as expected):
'2005-06-03 09:36:41.849402'
'2005-06-03 09.36.41.849402'
THIS IS INSANE. The statement:
if ($foo eq $sql_timestamp) {
should be functionally IDENTICAL to
if ($foo =~ /^$sql_timestamp$/) {
RIGHT?????
Perl seems to have gone completely crazy!
Does anyone have ANY idea what could possibly be going on here? This is
driving me nuts.
I'm using Perl 5.8.4 built for AIX 5.1MR2. DBIx::Simple is 1.26, FWIW.
Thanks for looking!