in reply to Re: understanding eval in HPOJ
in thread understanding eval in HPOJ

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