Dpkg::Interface::Storable - common methods related to object serialization
| Use Case | Command | Description |
|---|---|---|
| π Load object from file | $obj->load($filename) | Initialize object from file, autoβdecompress |
| πΎ Save object to file | $obj->save($filename) | Store object to file, autoβcompress |
| π₯ Parse from filehandle | $obj->parse($fh) | Read object data from an open filehandle |
| π€ Output to string | $obj->output() | Return string representation of object |
| π¨οΈ Output to filehandle | $obj->output($fh) | Write string representation to filehandle |
| π€ Stringify object | "$obj" | Overloaded stringification (calls output) |
Dpkg::Interface::Storable is only meant to be used as parent class for
other classes. It provides common methods that are all implemented on
top of two basic methods parse() and output().
Those methods must be provided by the class that wish to inherit from Dpkg::Interface::Storable so that the methods provided can work.
$obj->parse($fh[, $desc]) β This method initializes the object with the data stored in the filehandle. $desc is optional and is a textual description of the filehandle used in error messages.$string = $obj->output([$fh]) β This method returns a string representation of the object in $string and it writes the same string to $fh (if it's defined).$obj->load($filename, %opts) β Initialize the object with the data stored in the file. The file can be compressed, it will be decompressed on the fly by using a
Dpkg::Compression::FileHandle object. If $opts{compression} is false the decompression support will be disabled. If $filename is "-", then the standard input is read (no compression is allowed in that case).$obj->save($filename, %opts) β Store the object in the file. If the filename ends with a known compression extension, it will be compressed on the fly by using a
Dpkg::Compression::FileHandle object. If $opts{compression} is false the compression support will be disabled. If $filename is "-", then the standard output is used (data are written uncompressed in that case)."$obj" β Return a string representation of the object (via overloaded stringification).New options: The $obj->load() and $obj->save() methods support a new compression option.
Mark the module as public.
Generated by phpman v4.9.25-3-gdbaf087 Author: Che Dong Under GNU General Public License
2026-07-06 23:12 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format