The code is from the file hpoj (no extension), which is installed as part of the hpoj-0.90-14 RPM for RedHat Linux 9. It's 1339 lines long, but here are lines one through six: unchanged...
#!/usr/bin/perl
# LANG=C is a work around for bug 82652.
# The easier work-around of setting LANG=C in perl script itself didn'
+t
# work. It's probably too late by then.
eval '(exit $?0)' && eval 'exec env LANG=C $0 ${1+"$@"}'
if $ENV{"LANG"} != "C";
Really?! No one is familiar with exec and eval?
eval "evaluates" perl code or an expression and exec terminates the currently running Perl script and executes it's arguments in the current shell, ie: without creating a new process ID.
There is no eval command in Bash, but the exec command does work in a similar fashion, executing it's arguments without creating a new process.
I think both execs are actually based on a similar function in the standard programming library for Unix-like operating systems.
|