Data::Tools provides set of basic functions for data manipulation.
use Data::Tools qw( :all ); my $res = file_save( $file_name, 'file data here' ); my $data = file_load( $file_name ); my $res = dir_path_make( '/path/to/somewhere' ); # create full path with 0700 my $path = dir_path_ensure( '/path/s/t/h' ); # ensure path exists, check+make my $escaped = str_url_escape( $plain_str ); # url-style %XX escaping my $plain_str = str_url_unescape( $escaped ); my $hex_str = str_hex( $plain_str ); # hex-style string escaping my $plain_str = str_unhex( $hex_str ); my $hash_str = hash2str( $hash_reference ); # convert hash to string "key=value\n" my $hash_reference = str2hash( $hash_str ); # save/load hash in str_url_escaped form to/from a file my $res = hash_save( $file_name, $hash_reference ); my $hash_reference = hash_load( $file_name ); my $perl_pkg_fn = perl_package_to_file( 'Data::Tools' ); # returns "Data/Tools.pm"
(more docs)
Vladi Belperchinov-Shabanski "Cade" <cade@biscom.net> <cade@datamax.bg> <cade@cpan.org> http://cade.datamax.bg
To install Data::Tools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Tools
CPAN shell
perl -MCPAN -e shell install Data::Tools
For more information on module installation, please visit the detailed CPAN module installation guide.