develooper Front page | perl.perl5.porters | Postings from September 2022

Re: module loading built-in

Thread Previous | Thread Next
Aaron Priven
September 19, 2022 16:35
Re: module loading built-in
Message ID:
I wonder if it wouldn’t be more flexible to have

module_file_of (‘Foo::Bar’);

and then allow that to be loaded into require or used for any other desired purpose, rather than having a special “load” routine.


	my $x = module_name_of('Foo::Bar');
	require $x;

would be equivalent to

	require Foo::Bar;

Or, maybe not.

To be honest, I’m not sure to what other purposes this function could be put, but it strikes me as the wrong thing to have some kind of data munging that can only be accessed through a separate function (as though we only had printf and not sprintf).

Aaron Priven,,

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About