<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Would it be easier to create a class that knows what you want?<br>
<br>
$target = $hosts-&gt;rsync_target($hostname);<br>
and quickly code in your own magic?<br>
<br>
<br>
-stephen<br>
<br>
<br>
<!--[if gte mso 9]><xml>&#13; <o:DocumentProperties>&#13;  <o:Template>Normal</o:Template>&#13;  <o:LastAuthor>Eco Warrior</o:LastAuthor>&#13;  <o:Revision>2</o:Revision>&#13;  <o:Created>2005-10-26T18:53:00Z</o:Created>&#13;  <o:LastSaved>2005-10-26T19:28:00Z</o:LastSaved>&#13;  <o:Pages>2</o:Pages>&#13;  <o:Words>284</o:Words>&#13;  <o:Characters>1621</o:Characters>&#13;  <o:Company>EcoStream</o:Company>&#13;  <o:Lines>13</o:Lines>&#13;  <o:Paragraphs>3</o:Paragraphs>&#13;  <o:CharactersWithSpaces>1990</o:CharactersWithSpaces>&#13;  <o:Version>10.2006</o:Version>&#13; </o:DocumentProperties>&#13;</xml><![endif]--><!--[if gte mso 9]><xml>&#13; <w:WordDocument>&#13;  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>&#13;  <w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>&#13;  <w:UseMarginsForDrawingGridOrigin/>&#13; </w:WordDocument>&#13;</xml><![endif]--><!--[if gte mso 9]><xml>&#13; <o:shapedefaults v:ext="edit" spidmax="10
27"/>&#13;</xml><![endif]--><!--[if gte mso 9]><xml>&#13; <o:shapelayout v:ext="edit">&#13;  <o:idmap v:ext="edit" data="1"/>&#13; </o:shapelayout></xml><![endif]-->
<br>
Stephen Cataldo<br>
SpaceShare.com<br>
6420 Colby St.<br>
Oakland, CA 94618<br>
(510) 520-6175<br>
<br>
Replacing Cars with Community:<br>
<small style="color: rgb(0, 51, 0);">Interested in learning more about
SpaceShare? Join our monthly newsletter list:
<a class="moz-txt-link-abbreviated" href="http://www.spaceshare.com/email_newsletter">www.spaceshare.com/email_newsletter</a></small><br>
<br>
<br>
<br>
but I suppose procrastination is False Laziness.<br>
<br>
David Alban wrote:
<blockquote
 cite="mid4c714a9c0607011842ob8907d1v62fd260e84f727bd@mail.gmail.com"
 type="cite">
  <pre wrap="">Greetings,

Say I want to do something like:

  $hosts =&gt; {
      foo =&gt; {
          source_tree  =&gt; '/some/dir',
          rsync_target =&gt; "bat:$spool_dir/foo/",
      },
      bar =&gt; {
          source_tree  =&gt; '/some/other/dir',
          rsync_target =&gt; "bat:$spool_dir/bar/",
      },
      .
      .
      .
  };

But I don't want to hardcode hostnames "foo" and "bar" in the
rsync_target values.  Is there a way to do something like:


  $hosts =&gt; {
      foo =&gt; {
          source_tree  =&gt; '/some/dir',
          rsync_target =&gt; "bat:$spool_dir/" . __KEY__ . '/',
      },
      bar =&gt; {
          source_tree  =&gt; '/some/other/dir',
          rsync_target =&gt; "bat:$spool_dir/" . __KEY__ . '/',
      },
      .
      .
      .
  };

That is, is there some magic string I can put in the source to
indicate to the compiler to use the value of the current hash key?

Of course, I just noticed that this ability would have to allow the
coder to specify out to what level the magic string referred.  'Cause
in my example, I wouldn't want the value substituted for __KEY__ to be
the string  'rsync_target'. :-)

Thanks,
David
  </pre>
</blockquote>
</body>
</html>