App::MBUtiny::Util - Internal utilities used by App::MBUtiny module
Version 1.03
use App::MBUtiny::Util qw/ filesize explain hide_password md5sum resolv sha1sum /; my $fsize = filesize( $file ); print explain( $object ); print hide_password('http://user:password@example.com'); my $md5 = md5sum( $file ); my $name = resolv( $IPv4 ); my $sha1 = sha1sum( $filename );
Internal utility functions
print explain( $object );
Returns Data::Dumper dump
my $fsize = filesize( $file );
Returns file size
print hide_password('http://user:password@example.com'); # 'http://user:*****@example.com'
Returns specified URL but without password
my $md5 = md5sum( $filename );
See Digest::MD5
my $anode = node2anode({});
Returns array of nodes
my ($user, $password) = parse_credentials( 'http://user:password@example.com' ); my ($user, $password) = parse_credentials( new URI('http://user:password@example.com') );
Returns credentials pair by URL or URI object
my $name = resolv( $IPv4 ); my $ip = resolv( $name );
Resolv ip to a hostname or hostname to ip. See "resolv" in Sys::Net, "inet_ntoa" in Socket and "inet_aton" in Socket
my $hash = set2attr({set => ["AttrName Value"]}); # {"AttrName" => "Value"}
Converts attributes from the "set" format to regular hash
my $sha1 = sha1sum( $filename );
See Digest::SHA1
xcopy( $src_dir, $dst_dir, [ ... exclude rel. paths ... ] );
Exclusive copying all objects (files/directories) from $src_dir directory into $dst_dir directory without specified relative paths. The function returns status of work
xcopy( "/source/folder", "/destination/folder" ) or die "Can't copy directory"; # Copying without foo and bar/baz files/directories xcopy( "/source/folder", "/destination/folder", [qw( foo bar/baz )] ) or die "Can't copy directory";
See Changes file
Changes
Serż Minus (Sergey Lepenkov) http://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See LICENSE file and https://dev.perl.org/licenses/
LICENSE
To install App::MBUtiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MBUtiny
CPAN shell
perl -MCPAN -e shell install App::MBUtiny
For more information on module installation, please visit the detailed CPAN module installation guide.