Re: s/// w/o intermediate variables?

Rick Delaney <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On Tue, May 04, 2004 at 11:13:38AM -0400, [email protected] wrote:
> 
> Here's an example of a recurrent annoyance:
> 
>   my $package = 'Foo::Bar::Baz';
>   (my $package_filename = $package) =~ s,::,/,g;
>   require $package_filename;
>   $package->foobar();

This doesn't answer the general question but don't let the eval police
scare you away from

   my $package = 'Foo::Bar::Baz';
   eval "require $package;1" or die $@;
   

-- 
Rick Delaney
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.