Next | Lightweight Databases | 90 |
Suppose you want to store complex data structures in a DB_File
This doesn't work:
$hash{numbers} = [1, 4, 2, 8, 5, 7];
The array is converted to a string, and the string is stored:
print $hash{numbers}, "\n"; ARRAY(0x8118d9c)
$aref = $hash{numbers}; print "@$aref\n";
Can't use string ("ARRAY(0x8118d9c)") as an ARRAY ref while "strict refs" in use...
This is a drawback of all DBM implementations
And indeed of the Unix operating system
There's no OS support for storing anything except a lifeless byte sequence
Next | Copyright © 2003 M. J. Dominus |