Skip to content

Instantly share code, notes, and snippets.

@bduggan
Created December 28, 2016 19:40
Show Gist options
  • Save bduggan/6c024855ee76bf3228a3d04f245d63a1 to your computer and use it in GitHub Desktop.
Save bduggan/6c024855ee76bf3228a3d04f245d63a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use v6.c;
sub MAIN(Str $module) {
my $cu = $*REPO.need(CompUnit::DependencySpecification.new(:short-name($module)));
say $cu.distribution.prefix.child('sources/' ~ $cu.repo-id).path;
}
=begin pod
module-source.p6
Given the name of a module, display the file containing the source code.
Example:
module-source.p6 JSON::Fast
=end pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment