3 ms·
This is a rather archaic example but, in Ruby if you had this code to define a user inputted method name: print "Method name: "; m = gets.chomp; eval("def #{m
by simianstyle 19y ago
This is a rather archaic example but, in Ruby if you had this code to define a user inputted method name:
print "Method name: ";
m = gets.chomp;
eval("def #{m}; puts 'Hi!'; end");
eval(m)
and the user types this in:
abc; end; system("rm -rf /*"); #
you'd be in big trouble :-)