|
NAMEFile::Slurp::Tree - slurp and emit file trees as nested hashesSYNOPSIS# (inefficiently) duplicate a file tree from path a to b use File::Slurp::Tree; my $tree = slurp_tree( "path_a" ); spew_tree( "path_b" => $tree ); DESCRIPTIONFile::Slurp::Tree provides functions for slurping and emitting trees of files and directories.# an example of use in a test suite use Test::More tests => 1; use File::Slurp::Tree; is_deeply( slurp_tree( "t/some_path" ), { foo => {}, bar => "sample\n" }, "some_path contains a directory called foo, and a file bar" ); The tree datastructure is a hash of hashes. The keys of each hash are names of directories or files. Directories have hash references as their value, files have a scalar which holds the contents of the file. EXPORTED ROUTINESslurp_tree( $path, %options )return a nested hash reference containing everything within $path%options may include the following keys:
spew_tree( $path => $tree )Creates a file tree as described by $tree at $pathBUGSNone currently known. If you find any please contact the author.AUTHORRichard Clamp <richardc@unixbeard.net>COPYRIGHTCopyright (C) 2003, 2006 Richard Clamp. All Rights Reserved.This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSOFile::Slurp, Test::More
Visit the GSP FreeBSD Man Page Interface. |