[sf-perl] Make a hash key's value dependent on the key itself?

David Alban extasia at extasia.org
Wed Jul 5 16:15:04 PDT 2006


Thanks, Gavin.

I like that idea!

Unfortunately, almost no matter what I use, there's always the danger
of "cut and paste" error.  The data is going to be in the source (or
in a config file) somewhere in some form.  And the error will happen
at "edittime", not runtime.  At least with the token
("::SOURCEHOST::") I don't have to worry about that so much.

On 7/3/06, Gavin Jefferies <gavin at fastperl.com> wrote:
> mkhosts(foo => {
>          source_tree  => '/some/dir',
>          rsync_target => "bat:$spool_dir/::SOURCEHOST::/",
>      });
>
> mkhosts(bar => {
>          source_tree  => '/some/other/dir',
>          rsync_target => "bat:$spool_dir/::SOURCEHOST::/",
>      });
>
> mkhosts(bat => {
>          source_tree => '/yet/another/dir',
>          rsync_target =>
> "mumble:$raid_root/::SOURCEHOST::/",
>      });

-- 
Live in a world of your own, but always welcome visitors.


More information about the SanFrancisco-pm mailing list