Tim Harsch wrote:
>
> how do you use undef when you mean to without -w barking this at you:
> Use of uninitialized value at
> /usr/local/perl5.005/lib/site_perl/DBD/Sybase.pm line 121.
>
> code snip:
> $hDB->do( <<SQL );
> create table #temp_for_this_session
> ( fld1 int not null,
> fld2 varchar(20) null )
> SQL
>
> my @myvalues = (
> [ 5, undef ],
> );
>
> foreach my $myvalue ( @myvalues ) {
> my $sql = 'insert into #temp values ( ?, ? )';
> $hDB->do( $sql, {}, @$myvalue );
> } # end foreach
>
> __END__
>
> I'm supposed to use undef to indicate NULL in the database right? Should
> Sybase.pm be checking for undef before trying to use the value?
I think you need to remove the leading "@" on @$myvalue. That deferences
$myvalue as an array there, when you just need a scalar. I think it's
complaining because you are trying to use undef as an array reference.
-mark
http://mark.stosberg.com/