<br><br><div class="gmail_quote">On Tue, Feb 22, 2011 at 1:50 AM, John Ricker <span dir="ltr">&lt;<a href="mailto:sephtin%2Bpm-talk@gmail.com">sephtin+pm-talk@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><div class="gmail_quote">On Tue, Feb 22, 2011 at 2:08 AM, Mike South <span dir="ltr">&lt;<a href="mailto:msouth@gmail.com" target="_blank">msouth@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><br><div class="gmail_quote"><div><div></div><div>On Mon, Feb 21, 2011 at 10:21 PM, John Ricker <span dir="ltr">&lt;<a href="mailto:sephtin@gmail.com" target="_blank">sephtin@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div></blockquote></div></div></div></blockquote><div> </div><div>[snip]</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div>Re: the &quot;bash&#39;ish&quot; way... was the only way I could come up with that didn&#39;t load everything regardless of what I needed... other than splitting up each theme into separate files, which I&#39;m trying to avoid.</div>

<div>My failure was with use(), since it required path at runtime (using lib) which I couldn&#39;t provide at compile time as the path is a variable defined in the file.</div><div>I DID attempt require, but wasn&#39;t able to pass the variable to the config file.  I must have been doing something wrong because after checking Mike&#39;s example and switching things back for require, it seems to be working...  I&#39;ll probably comment it out, and try what seems to be the most recommended method... just hashing everything, and reading it that way... good learning experience at the very least...   :)</div>

<div><br></div></div></blockquote><div><br></div><div>I just looked through the example and realized I had forgotten to cut part of it out.  Sorry if this was confusing.  The &quot;$which_dir&quot; variable should be removed completely, in favor $theme_sub_dir.  The idea was to show that $theme_sub_dir wasn&#39;t known until runtime (since it&#39;s being pulled in from the environment), and demonstrate how to require() something from that dynamically-determined dir.  The $which_dir variable was from when I was making sure I was right about how I thought it worked :).  Change that section to look like this:</div>
<div><br></div><div><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px; "><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">#comment this out </font></div>
<div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">#our $which_dir = &#39;bob&#39;;</font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace"><br>
</font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">$which_config = &#39;one&#39;;</font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">#$which_config = &#39;two&#39;;</font></div>
<div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace"><br></font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">my $theme_sub_dir = $ENV{theme} || die &quot;set theme in the env like this: theme=&#39;test&#39; $0\n&quot;;</font></div>
<div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace"><br></font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">my $full_path_to_require = &quot;/Users/msouth/$theme_sub_dir&quot;;</font></div>
<div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">die &quot;there is not a directory called $full_path_to_require&quot; unless -d $full_path_to_require;</font></div><div style="font-family: arial, sans-serif; ">
<font face="&#39;courier new&#39;, monospace">push @INC, $full_path_to_require;;</font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace"><br></font></div><div style="font-family: arial, sans-serif; ">
<font face="&#39;courier new&#39;, monospace">#just use the file name since @INC has been modified </font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">#require &quot;$which_dir/<a href="http://set_up_bob.pl/" target="_blank" style="color: rgb(0, 0, 204); ">set_up_bob.pl</a>&quot;;</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace">require &quot;<a href="http://set_up_bob.pl">set_up_bob.pl</a>&quot;; # require &quot;$full_path_to_require/<a href="http://set_up_bob.pl">set_up_bob.pl</a>&quot; would work here, too</font></div>
<div style="font-family: arial, sans-serif; "><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">mike</font></div>
</span></div></div>