Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: eval, but syntax-check only -- like perl -c

by seattlejohn (Deacon)
on Apr 25, 2003 at 03:00 UTC ( #253052=note: print w/replies, xml ) Need Help??


in reply to Re: eval, but syntax-check only -- like perl -c
in thread eval, but syntax-check only -- like perl -c

You're probably aware of this already, but there will still be ways for sneaky programmers to get around restrictions like that. For instance:
my @backward_chars = ('e', 's', 'u'); my $watch_out = (reverse join "",@backward_chars) . " Data::Dumper;"; eval $watch_out; my $x = Dumper([1,2,3]); print $x;

I've managed to use Data::Dumper without "use" every appearing explicitly in the code.

Update: D'oh, I forgot to consider the all-important "wrap in an anonymous subroutine" part, which would seem to defer actual execution of the code. My bad.

        $perlmonks{seattlejohn} = 'John Clyman';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2023-01-28 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?