Wrong. That problem only exists with the string form of eval, not the block form shown, which is the standard Perl equivalent of the try()/catch() pairing found in other languages. Ie. it is the proper way to do this.
I know you're using it the proper way, but i only state to be careful with it and that you absolutely should know what you're doing, (As stated
if improper used.. Thats why i try to avoid the usage of it, a mistake is easily made like this:
#!/usr/bin/perl -w
use stritct;
my $c1 = 'system("touch /tmp/test1.txt")';
my $c2 = 'system("touch /tmp/test2.txt")';
#used as string (Dangerous!!!)
eval $c1;
#used as block (ok)
eval {$c2}; # <- gives a useless use of private variable in void cont
+ext.
.
"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.