I think you probably don't want the extra quotes. require "filename" means to require a filename, where require File::Name means to search @INC for a class (filename of File/Name.pm).
The usual reason behind the use of eval "require ..." is to make the contents of your variable into a bare word. The other reason, obviously, is to trap errors if the module is missing; or to execute the require at runtime instead of doing it before main execution.
You might also consider interpolation, so you don't have to explicitly concatenate like that.
eval "require $ARGV[0]"; die $@ if $@;
I have assumed that "foo::try" actually is in another file. If it's in the same file, your require is never going to work. :)
-Paul
In reply to Re: Issues with including via eval 'require'
by jettero
in thread Issues with including via eval 'require'
by yaneurabeya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |