Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'use module()' analog at 'use if' module. #15078

Closed
p5pRT opened this issue Dec 8, 2015 · 5 comments
Closed

Implement 'use module()' analog at 'use if' module. #15078

p5pRT opened this issue Dec 8, 2015 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 8, 2015

Migrated from rt.perl.org#126841 (status was 'rejected')

Searchable as RT126841$

@p5pRT
Copy link
Author

p5pRT commented Dec 8, 2015

From @KES777

Sometimes we want to load module but do not want the import is called. We use the syntax​:
use module ();
But his seems can not be done with 'use if cond, 'module', ()';

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

From zefram@fysh.org

Eugen Konkov wrote​:

But his seems can not be done with 'use if cond, 'module', ()';

if.pm is only designed to handle the most common cases of conditional
pragma usage. Your less-common case can readily be handled using
procedural code in a BEGIN block. It is not worth adding another if-alike
just for this case.

-zefram

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

From @csjewell

On Tue Dec 08 01​:49​:04 2015, KES wrote​:

Sometimes we want to load module but do not want the import is called.
We use the syntax​:
use module ();
But his seems can not be done with 'use if cond, 'module', ()';

You do it with BEGIN { require Module if X; } instead, because use Module (); is identical in effect to BEGIN { require Module; }.

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

@rjbs - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant