in reply to Hashing uninitialized values when no value returned from DBI sql select
If not, use kyle's suggestion:
$myhash{$val_1} = defined $val_2 ? $val_2 : '';
If your prog does care, you'll just have to explicitly check for definedness at each subsequent usage of the value, or use an SQL fn like ifnull(col1, val1, val2) or the local equiv, to cvt it to an unused value eg '~'.
|
|---|