NAME
DBIx::FileStore::UtilityFunctions -- Utility functions for DBIx::FileStore
SYNOPSIS
# converts from bytes to something prettier like 10.1G.
my
$size
= convert_bytes_to_human_size(
$bytecount
)
"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"
);
DESCRIPTION
Provides three functions:
get_user_homedir(), get_date_and_time(), and convert bytes_to_human_size().
FUNCTIONS
- my $size = convert_bytes_to_human_size( $bytecount )
-
Converts an integer (like 5 or 10100) into a string for display like 5B, 10.1K, 20.7M, or 33G.
- my $date_string = get_date_and_time( $optional_time );
-
Returns a string with the date and time, either for now or the epoch-based $time passed.
- my $homedir = get_user_homedir( $optional_username );
-
Returns the home directory for the current user, or the one whose name is passed.
COPYRIGHT
Copyright (c) 2010-2017 Josh Rabinowitz, All Rights Reserved.
AUTHORS
Josh Rabinowitz