=encoding euc-jp =head1 名前 File::Slurp::Tree - ネストしたハッシュでファイルを丸呑み、吐き出します。 =head1 概要 # パスaからbへ(非効率的に)ファイル・ツリーを複製します use File::Slurp::Tree; my $tree = slurp_tree( "path_a" ); spew_tree( "path_b" => $tree ); =head1 説明 File::Slurp::Treeはファイルとディレクトリのツリーを丸呑みし、吐き出す ための関数を提供します。 # テストのなかでの利用例 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" ); ツリーのデータ構造はハッシュのハッシュです。それぞれのハッシュのキーは ディレクトリあるいはファイルの名前になっています。ディレクトリは その値としてハッシュのリファレンスを持っています。 ファイルはそのファイルの内容が入ったスカラーを持っています。 =head1 エクスポートされるルーチン =head2 slurp_tree( $path, %options ) $pathにある全てのものが入った、ネストしたハッシュ・リファレンスを 返します。 %optionsには以下のキーをいれることができます: =over =item rule パスのなかでファイルとディレクトリにマッチするL オブジェクト。デフォルトは空ルール(全てにマッチします) =back =head2 spew_tree( $path => $tree ) C<$tree>によって記述されるファイル・ツリーをC<$path>に作成します。 =head1 バグ 現在のところ何も知られていません。もし何か見つけたら、 あなたのレポートをbug-File-Slurp-Tree@rt.cpan.orgにメールする ことによってLを利用するか、私に直接 コンタクトしてください。 =head1 作者(=AUTHOR) Richard Clamp =head1 著作権(=COPYRIGHT) Copyright (C) 2003 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. =head1 参考資料 L, L