Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by seattlejohn (Deacon)
on Apr 25, 2003 at 03:00 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found