It uses eval EXPR for #line to work. It has nothing to do with require. (eval BLOCK would suffice if you wanted to catch exceptions.)
The following will work (even if your platform doesn't use / as the path seperator):
$class = 'HTTP/Request.pm'; require $class;
However, transforming the class name into a path is really no better.
In reply to Re^3: eval "require $class" seems wrong
by ikegami
in thread eval "require $class" seems wrong
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |