[Purdue-pm] help!

Bradley Andersen bradley.d.andersen at gmail.com
Wed May 16 10:20:46 PDT 2012


ok, i just fixed it, but i'd like to still figure out why it worked then
stopped.  there must be something wrong with the earlier logic.  for
reference, here's what i did:

i replaced:
1999             #####open(FH, "$base/helping$full.html") || die "\n\nCould
not READ $base/helping$full.html: [$!]\n\n";
2000             #####$tpl->param("m$full" => do { local $/; while (<FH>) {
my $next = <FH>; } });

with:
2001
2002             my $contents;
2003             {
2004                 local $/;
2005                 open(FH, "$base/helping$full.html") || die "\n\nCould
not READ $base/helping$full.html: [$!]\n\n";
2006                 $contents = <FH>;
2007                 close(FH);
2008             }
2009             $tpl->param("m$full" => $contents);

Can you see immediately why the first one would be no good? It almost seems
like the tpl->param is not being set as a string.  That is, clearly it
reads it, but it is not assigning the result properly as a string.  All I
got were undefs in the log for the earlier logic.  I am 199% sure this
worked using the earlier logic yesterday.

Thanks!
/bda



On Wed, May 16, 2012 at 1:00 PM, Bradley Andersen <
bradley.d.andersen at gmail.com> wrote:

> ok, just did that.
>
> it is CLEARLY reading the entire file set in ;)
>
>
>
>
> On Wed, May 16, 2012 at 12:58 PM, Bradley Andersen <
> bradley.d.andersen at gmail.com> wrote:
>
>> I guess next step is to issue prints in the while and watch what happens
>> as I load the page.  But man, that's gonna be a lot of output :)
>>
>>
>>
>>
>> On Wed, May 16, 2012 at 12:57 PM, Bradley Andersen <
>> bradley.d.andersen at gmail.com> wrote:
>>
>>> I had this in there earlier, sorry:
>>> open(FH, "$base/helping$full.html") || die "\n\nCould not READ
>>> $base/helping$full.html: [$!]\n\n";
>>>
>>> it prints nothing :(
>>>
>>> so i think it _is_ reading the files, but it is not reading them into
>>> the tpl->params somehow?
>>>
>>>
>>>
>>>
>>>
>>> On Wed, May 16, 2012 at 12:48 PM, Mark Senn <mark at ecn.purdue.edu> wrote:
>>>
>>>>  > open(FH, "$base/m10.html");
>>>>
>>>> I'd debug this by starting with checking that the file
>>>> got opened successfully:
>>>>
>>>>    my $fn = "$base/m10.html";
>>>>    open FH, '<', $fn  or  die qq/Can't open "$fn" for input:
>>>> $!.\nStopped/;
>>>>
>>>> -mark
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/purdue-pm/attachments/20120516/94658aca/attachment.html>


More information about the Purdue-pm mailing list