in reply to Re^2: input special characters
in thread input special characters
Now the user enters this:# file eval.pl use strict; use warnings; my $sep = shift @ARGV; my $evaled = eval "qq/$sep/"; print "$evaled:\n"
Result:perl eval.pl 'hehe/; print "Hello there!\n"; unlink "./eval.pl"; q/foo +'
And the eval.pl file is gone. So, yeah... as I said, eval is usually more trouble than it's worth. Maybe consider module Safe, which provides restricted eval, if you're dealing with users there (users are evil).Useless use of a constant ("hehe") in void context at (eval 1) line 1. Hello there! foo:
|
|---|