I have just confirmed using the latter (new) method that the first <FH> does not do what I had thought (skip first line of the file read).<br><br>So Joe's comment about trying to be too clever on that bit looks correct.<br>
<br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 1:27 PM, Bradley Andersen <span dir="ltr"><<a href="mailto:bradley.d.andersen@gmail.com" target="_blank">bradley.d.andersen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah, in the end I don't care if it is clever or not, so long as the code works and it is readable :)<div class="HOEnZb">
<div class="h5"><br><br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 1:25 PM, Joe Kline <span dir="ltr"><<a href="mailto:gizmo@purdue.edu" target="_blank">gizmo@purdue.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<div><br>
On 05/16/2012 01:20 PM, Bradley Andersen wrote:<br>
> ok, i just fixed it, but i'd like to still figure out why it worked<br>
> then stopped.  there must be something wrong with the earlier<br>
> logic.  for reference, here's what i did:<br>
><br>
> i replaced: 1999             #####open(FH,<br>
> "$base/helping$full.html") || die "\n\nCould not READ<br>
> $base/helping$full.html: [$!]\n\n"; 2000<br>
> #####$tpl->param("m$full" => do { local $/; while (<FH>) { my $next<br>
> = <FH>; } });<br>
><br>
> with: 2001 2002             my $contents; 2003             { 2004<br>
> local $/; 2005                 open(FH, "$base/helping$full.html")<br>
> || die "\n\nCould not READ $base/helping$full.html: [$!]\n\n"; 2006<br>
> $contents = <FH>; 2007                 close(FH); 2008<br>
> } 2009             $tpl->param("m$full" => $contents);<br>
><br>
> Can you see immediately why the first one would be no good? It<br>
> almost seems like the tpl->param is not being set as a string.<br>
> That is, clearly it reads it, but it is not assigning the result<br>
> properly as a string.  All I got were undefs in the log for the<br>
> earlier logic.  I am 199% sure this worked using the earlier logic<br>
> yesterday.<br>
><br>
<br>
</div>Brad,<br>
<br>
I don't see much of a reason why the file slurping wasn't<br>
working...maybe that bit to strip the first line out was a bit too much?<br>
<br>
It took me a bit to figure out why that slurp line looked familiar but<br>
odd:<br>
<br>
<a href="http://www.modernperlbooks.com/mt/2009/08/a-one-line-slurp-in-perl-5.html" target="_blank">http://www.modernperlbooks.com/mt/2009/08/a-one-line-slurp-in-perl-5.html</a><br>
<br>
I guess just an example where the less clever option worked out better.<br>
<br>
joe<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2.0.14 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
iEYEARECAAYFAk+z4xwACgkQb0mzA2gRTpkaZwCghpbMGF2dWaw0kiEXaEjWf0Uy<br>
hQsAn2YFkhpY5WPmVPe9BsMTTSC7gphi<br>
=uVn0<br>
-----END PGP SIGNATURE-----<br>
_______________________________________________<br>
Purdue-pm mailing list<br>
<a href="mailto:Purdue-pm@pm.org" target="_blank">Purdue-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/purdue-pm" target="_blank">http://mail.pm.org/mailman/listinfo/purdue-pm</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>