[Purdue-pm] help!
Joe Kline
gizmo at purdue.edu
Wed May 16 10:25:48 PDT 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/16/2012 01:20 PM, Bradley Andersen wrote:
> 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.
>
Brad,
I don't see much of a reason why the file slurping wasn't
working...maybe that bit to strip the first line out was a bit too much?
It took me a bit to figure out why that slurp line looked familiar but
odd:
http://www.modernperlbooks.com/mt/2009/08/a-one-line-slurp-in-perl-5.html
I guess just an example where the less clever option worked out better.
joe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk+z4xwACgkQb0mzA2gRTpkaZwCghpbMGF2dWaw0kiEXaEjWf0Uy
hQsAn2YFkhpY5WPmVPe9BsMTTSC7gphi
=uVn0
-----END PGP SIGNATURE-----
More information about the Purdue-pm
mailing list