Footprintless::Util - A utility method package for common functionality in Footprintless
version 1.0
use Footprintless::Util qw( agent default_command_runner dumper exit_due_to slurp spurt ); my $agent = agent(); my $command_runner = default_command_runner(); my $dumper = dumper(); eval { $command_runner->run_or_die('cat /foo/bar'); }; exit_due_to($@) if ($@); my $content = slurp('/foo/bar'); spurt('baz', '/foo/bar', append => 1);
This module contains common utility methods used by Footprintless.
Returns a new instance of LWP::UserAgent configured with env_proxy.
LWP::UserAgent
env_proxy
Returns a new instance of the default implementation of Footprintless::CommandRunner.
Footprintless::CommandRunner
Prints a dump of @to_dump using Data::Dumper with Data::Dumper::Indent set to 1.
@to_dump
Data::Dumper
Data::Dumper::Indent
If $reason is an instance of Footprintless::CommandRunner::Exception, $reason->exit() will be called. Otherwise, $reason will be printed to STDERR and exit(255) will be called.
$reason
Footprintless::CommandRunner::Exception
$reason->exit()
STDERR
exit(255)
Reads the entire contents of $file in one gulp.
$file
Writes $content to $file. The available options are:
$content
If truthy, $content will be appended to $file instead of overwriting.
Lucas Theisen <lucastheisen@pastdev.com>
This software is copyright (c) 2016 by Lucas Theisen.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please see those modules/websites for more information related to this module.
Footprintless
To install Footprintless, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Footprintless
CPAN shell
perl -MCPAN -e shell install Footprintless
For more information on module installation, please visit the detailed CPAN module installation guide.