| WebFetch documentation | Contained in the WebFetch distribution. |
WebFetch::Output::Dump - save data in a Perl structure dump
In perl scripts:
use WebFetch::Output::Dump;
From the command line:
perl -w -MWebFetch::Output::Dump -e "&fetch_main" -- --dir directory
--format dump --save save-path [...WebFetch output options...]
This is an output module for WebFetch which simply outputs a Perl
structure dump from Data::Dumper. It can be read again by a Perl
script using eval.
This function dumps the data into a string for saving by the WebFetch::save() function.
WebFetch was written by Ian Kluft
Send patches, bug reports, suggestions and questions to
maint@webfetch.org.
| WebFetch documentation | Contained in the WebFetch distribution. |
# # WebFetch::Output::Dump - save data in Perl structure dump # # Copyright (c) 1998-2009 Ian Kluft. This program is free software; you can # redistribute it and/or modify it under the terms of the GNU General Public # License Version 3. See http://www.webfetch.org/GPLv3.txt package WebFetch::Output::Dump; use strict; use base "WebFetch"; use Carp; use Scalar::Util qw( blessed ); use Date::Calc qw(Today Delta_Days Month_to_Text); use LWP::UserAgent; use Data::Dumper; # define exceptions/errors use Exception::Class ( );
# set defaults our ( @url, $cat_priorities, $now, $nowstamp ); our @Options = (); our $Usage = ""; # configuration parameters our $num_links = 5; # no user-servicable parts beyond this point # register capabilities with WebFetch __PACKAGE__->module_register( "output:dump" );
# Perl structure dump format handler sub fmt_handler_dump { my ( $self, $filename ) = @_; $self->raw_savable( $filename, Dumper( $self->{data})); 1; } 1; __END__ # POD docs follow