Hi,

I have some data from a dbi that looks  like this:

+-----------+-----------+--------+------------------------+
| title1 | title2 | oldtitle
------+----------------------------------------------------+
| NULL   | NULL   | The cat jumped over the mat


I used this statement to try and grab 1st, title1; 2nd title2; if all
fails there should be data in oldtitle


my $title = $image->title1 ? $image->title2 : $image->oldtitle;

But that didn't work I got an undef. So I tested with this:

#!/usr/bin/perl

use strict;
use warnings;

my $title1 = undef;
my $title2 = undef;
my $oldtitle = 'The cat jumped over the mat';

my $foo = $title1 ? $title2 : $oldtitle;

print "Foo=$foo\n";

And I go Foo=The cat jumped over the mat

Is there a difference between NULL in dbi (DBIx::Class) and scalars?
If so, will undef work?

Thanx,
Dp.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to