I'm trying to understand the following snippet of code, which doesn't seem to be working for me.
eval '(exit $?0)' && eval 'exec env LANG=C $0 ${1+"$@"}'
if $ENV{"LANG"} != "C";
What's happening in each
eval? Here's what it looks like to me. Please correct me...
- It's just sticking a 0 on the end of the end of the exit status for the last child process and exiting. But there is no last child process.
- Set LANG=C then execute the current script again with an argument that is somehow made from a 1 and the code for the syntax error from the first eval
I'm very confused.
This is a work-around for a bug with HP OfficeJet printer support on RedHat Linux. Since it's not working I was thinking of using this adaptation from another thread which helped me solve another, unrelated problem...
BEGIN {
unless ( $ENV{LANG} eq "C" ) {
$ENV{LANG} = "C";
exec 'env',$0,@ARGV;
}
}
I will be posting a question of this nature in their mailing list, too. But the Monks are much better :)
Thank you,
--
-- GhodMode
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.