eval "&$s()";Oof. Don't do that. It's a lot safer to turn of strict refs instead:
That should still be treated with care, though. It will run ANY subroutine (even in other packages) that can be reached by name. Using your eval STRING option will run ANY code that happens to be in $s. Like:no strict 'refs'; $s->(); use strict;
updated: fixed quoting$s = "print(); unlink '/etc/passwd'; s";
In reply to Re^2: How to call subroutines using variables ?
by Joost
in thread How to call subroutines using variables ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |