Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: understanding eval in HPOJ

by GhodMode (Pilgrim)
on Apr 04, 2004 at 20:25 UTC ( [id://342512]=note: print w/replies, xml ) Need Help??


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

ummm... definitely not Bash. Actually, exec and eval are fundamental Perl... http://www.perldoc.com/perl5.8.0/pod/func/eval.html http://www.perldoc.com/perl5.8.0/pod/func/exec.html
--
-- GhodMode

Replies are listed 'Best First'.
Re: Re: Re: understanding eval in HPOJ
by Vautrin (Hermit) on Apr 04, 2004 at 20:31 UTC
    I think the poster may have been referring to the fact that it uses environmental variables.

    Want to support the EFF and FSF by buying cool stuff? Click here.
Re: Re: Re: understanding eval in HPOJ
by ambrus (Abbot) on Apr 06, 2004 at 17:48 UTC

    It reminds me to some code by which you can run the same script under bash and perl too. One variant of such code is:

    #!/bin/sh -- # -*- perl -*- -p eval 'exec perl -wS $0 ${1+"$@"}' if $running_under_some_shell;

    This has both eval end exec.

    The more sophisticated one is:

    #! /bin/sh eval '(exit $?0)' && eval 'PERL_BADLANG=x;PATH="$PATH:.";export PERL_B +ADLANG\ ;exec perl -T -x -S -- "$0" ${1+"$@"};#'if 0;eval 'setenv PERL_BADLANG + x\ ;setenv PATH "$PATH":.;exec perl -T -x -S -- "$0" $argv:q;#'.q #!perl -wi.bak +push@INC,'.';$0=~/(.*)/s;do(index($1,"/")<0?"./$1":$1);die$@if$@__END +__+if 0 ;#Don't touch/remove lines 1--7: http://www.inf.bme.hu/~pts/Magic.Perl +.Header

    (Which runs under csh too).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found