I found a solution which I should've tried initially. I started by putting this in there after the variable was supposedly set:

system( 'echo "LANG=|$LANG|" | /bin/mail "LANG environment variable" m +yuser' );

Then I rebooted and found that it was not set like it should've been. It was set to "en_US.UTF-8", which I think it gets from the file /etc/sysconfig/i18n. I actually thought it might not even be getting past the goofy line because the first part is an exit.

I commented the two goofy lines and put the BEGIN block that I mentioned in the earlier post in there and rebooted again. I was pleased to see that my email says LANG=|C| and I checked the process listing and found that my printer daemon is running.

I don't fully understand what's happening in there, but thanks to halley's explanation, I get the idea. I think my solution will only work in my environment and is not as versatile as the original author intended. I'll read perlrun in a minute to see if I understand better.

Thanks to all for the brain cells. I'll post the problem and my solution to hpoj-devel and post here if they give me a Perlish solution and/or explanation.

--
-- GhodMode

In reply to Re: Re: understanding eval in HPOJ by GhodMode
in thread understanding eval in HPOJ by GhodMode

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.