in reply to Re: Runtime instantiation decisions
in thread Runtime instantiation decisions
whereas this is cheaper and safer (no firing up of the compiler):eval "require $class;"; # Note: "" *NOT* {} !
Please note that for future programs. (Yes, portabilty to macs and VMS is sacrificed.. for that, pull down File::Spec. But this works on Unix and Windows.)(my $file = $class) =~ s#/#::#g; require $file;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Re: Runtime instantiation decisions
by LogicalChaos (Beadle) on Mar 30, 2002 at 19:01 UTC |