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

Better documentation? (wish) #1

Closed
polettix opened this issue Sep 18, 2021 · 1 comment
Closed

Better documentation? (wish) #1

polettix opened this issue Sep 18, 2021 · 1 comment

Comments

@polettix
Copy link

Having to read this module's documentation from Sub::Exporter's is a pain the back.

Would it be possible to at least expand the SYNOPSIS with more useful examples?

Here's a proposal/starting point, I'm sure you can think additional/better ones:

# import a function with a custom name
use Sub::Import 'Digest::MD5', md5_hex => {-as => 'md5sum'};

# import multiple functions, each with its own name
use Sub::Import 'MIME::Base64',
  encode_base64 => {-as => 'e64'},
  decode_base64 => {-as => 'd64'};

# Import most functions with the "trig_" prefix, e.g. "trig_log",
# "trig_sin", "trig_cos", etc.
use Sub::Import 'Math::Trig', -all => {-prefix => 'trig_'};

# Import PI-related functions with the "_the_great" suffix, e.g.
# "pi_the_great", "pi2_the_great", etc.
use Sub::Import 'Math::Trig', -pi  => {-suffix => '_the_great'};
@rjbs
Copy link
Owner

rjbs commented Dec 31, 2022

Thanks, included!

@rjbs rjbs closed this as completed Dec 31, 2022
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

2 participants