#!/usr/bin/perl ############################################################ # dumpsto -- dump and undump Storable data files # Mike Schilli , 2002 ############################################################ use Storable qw(retrieve store_fd); use Data::Dumper; use Getopt::Std; use Pod::Usage; our $VERSION = "1.00"; our $CVSVERSION = '$Revision: 1.4 $'; getopts("hvu", \my %opts); pod2usage() if $opts{h}; if($opts{u}) { # Undump requested my $VAR1; my $in = join '', <>; eval $in; store_fd($VAR1, \*STDOUT); } else { # Dump requested pod2usage("No sto file given") unless @ARGV; print Data::Dumper::Dumper(retrieve @ARGV); } __END__ =head1 NAME dumpsto - Dump a Storable data file =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS # Dump a Storable file dumpsto data.sto >data.dump # Undump a dump into a Storable file dumpsto -u data.dump >data.sto Options: -h get help -v be verbose -u undump (convert a dump into a sto) =head1 DESCRIPTION C reads binary data files created by Perl's C module and dumps them in C format. This is useful if you want to peek what's inside a C data file. If you save the output of C in a file, you can even edit it: C can also convert C output back into a Storable file if called with the C<-u> option. =head1 LEGALESE Copyright 2002 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Mike Schilli Em@perlmeister.comE