DBIx::FileStore::UtilityFunctions -- Utility functions for DBIx::FileStore
# converts from bytes to something prettier like 10.1G. my $size = convert_bytes_to_human_size( $bytecount) print "12345678 bytes is " . convert_bytes_to_human_size(12345678) . "\n"; # get a pretty string with the date and time, either for now # or the epoch-based time passed: my $date_string = get_date_and_time(); my $once_upon_a_time = get_date_and_time( 1 ); # 1 second into 1970GMT # homedir fetching... my $my_homedir = get_user_homedir(); my $bobs_homedir = get_user_homedir( "bob" );
Provides three functions:
get_user_homedir(), get_date_and_time(), and convert bytes_to_human_size().
Converts an integer (like 5 or 10100) into a string for display like 5B, 10.1K, 20.7M, or 33G.
Returns a string with the date and time, either for now or the epoch-based $time passed.
Returns the home directory for the current user, or the one whose name is passed.
Copyright (c) 2010 Josh Rabinowitz, All Rights Reserved.
Josh Rabinowitz
To install DBIx::FileStore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::FileStore
CPAN shell
perl -MCPAN -e shell install DBIx::FileStore
For more information on module installation, please visit the detailed CPAN module installation guide.