"Fossies" - the Fresh Open Source Software Archive

Member "munin-2.0.52/contrib/dump_db" (20 Nov 2019, 401 Bytes) of package /linux/misc/munin-2.0.52.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /usr/bin/perl
    2 # Dump a binary dictionary to clear text hash
    3 # (c) GPL - Steve Schnepp <steve.schnepp@pwkf.org>
    4 
    5 use strict;
    6 use warnings;
    7 
    8 use Fcntl;   # For O_RDWR, O_CREAT, etc.
    9 use DB_File;
   10 
   11 while (my $db_file = shift) {
   12     my %hash;
   13     tie(%hash, 'DB_File', $db_file, O_RDONLY) or die "$!";
   14 
   15     for my $key (sort keys %hash) {
   16         my $value = $hash{$key};
   17         print "$key\t$value\n";
   18     }
   19     untie(%hash);
   20 }