Shell::Autobox - pipe Perl strings through shell commands
use Shell::Autobox qw(xmllint); my $xml = '<foo bar="baz"><bar /><baz /></foo>'; my $pretty = $xml->xmllint('--format -');
Shell::Autobox provides an easy way to pipe Perl strings through shell commands. Commands passed as arguments to the use Shell::Autobox statement are installed as subroutines in the calling package, and that package is then registered as the handler for methods called on ordinary (i.e. non-reference) scalars.
use Shell::Autobox
When a method corresponding to a registered command is called on a scalar, the scalar is passed as the command's standard input; additional arguments are passed through as a space-delimited list of options, and - if no error occurs - the command's standard output is returned. This can then be piped into other commands.
The registered methods can also be called as regular functions e.g.
use Shell::Autobox qw(cut); my $bar = cut("foo:bar:baz", "-d':' -f2");
None by default.
autobox
autobox::Core
Shell
chocolateboy <chocolate@cpan.org>
Copyright (c) 2005-2018 by chocolateboy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
0.40.0
To install Shell::Autobox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Shell::Autobox
CPAN shell
perl -MCPAN -e shell install Shell::Autobox
For more information on module installation, please visit the detailed CPAN module installation guide.