so i guess my error was in thinking that would somehow skip the first line of the file being read in.  now i need a different way to do that.<br><br><br><br><div class="gmail_quote">On Wed, May 16, 2012 at 1:53 PM, MCNAMARA, KEN <span dir="ltr"><<a href="mailto:km1921@att.com" target="_blank">km1921@att.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The sub routine returns the ‘last evaluated expression’.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you wrote (in the body of the subroutine):<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">my $value;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">while(<FH>) { $value = $_; }<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">return $value;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Then you get the contents of the file as intended.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">my $next = <FH>;  -- is meaningless since FH was already at end of file in “while(<FH>)”.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">KenMc<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> purdue-pm-bounces+km1921=<a href="mailto:att.com@pm.org" target="_blank">att.com@pm.org</a> [mailto:<a href="mailto:purdue-pm-bounces%2Bkm1921" target="_blank">purdue-pm-bounces+km1921</a>=<a href="mailto:att.com@pm.org" target="_blank">att.com@pm.org</a>]
<b>On Behalf Of </b>Bradley Andersen<br>
<b>Sent:</b> Wednesday, May 16, 2012 1:49 PM<br>
<b>To:</b> Joe Kline<br>
<b>Cc:</b> <a href="mailto:mark@purdue.edu" target="_blank">mark@purdue.edu</a>; Purdue Perl Mongers<br>
<b>Subject:</b> Re: [Purdue-pm] help!<u></u><u></u></span></p>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">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>
<u></u><u></u></p>
<div>
<p class="MsoNormal">On Wed, May 16, 2012 at 1:27 PM, Bradley Andersen <<a href="mailto:bradley.d.andersen@gmail.com" target="_blank">bradley.d.andersen@gmail.com</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">Yeah, in the end I don't care if it is clever or not, so long as the code works and it is readable :)<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<br>
<u></u><u></u></p>
<div>
<p class="MsoNormal">On Wed, May 16, 2012 at 1:25 PM, Joe Kline <<a href="mailto:gizmo@purdue.edu" target="_blank">gizmo@purdue.edu</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><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>
><u></u><u></u></p>
</div>
<p class="MsoNormal">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><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>

</blockquote></div><br>