Navigation Menu

Skip to content

Commit

Permalink
[Perl6/Module/Loader.pm] when a 'use' or 'need' cannot find a module,…
Browse files Browse the repository at this point in the history
… just say so and exit with doing an unnecessary stack trace.
  • Loading branch information
Martin Berends committed May 16, 2010
1 parent 92508d6 commit 32150d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Perl6/Module/Loader.pm
Expand Up @@ -16,11 +16,12 @@ method need($name, %name_adverbs?) {
Perl6::Module::Locator.find_module($name, @inc, %name_adverbs<ver>, %name_adverbs<auth>) !!
Perl6::Module::Locator.find_module_no_conditions($name, @inc);
if $pm_file eq '' {
pir::die("Unable to find module '$name'" ~
pir::say("Unable to find module '$name'" ~
(%name_adverbs<ver> ?? " with version '" ~ %name_adverbs<ver> ~ "'" !! "") ~
(%name_adverbs<ver> && %name_adverbs<auth> ?? ' and' !! '') ~
(%name_adverbs<auth> ?? " with authority '" ~ %name_adverbs<auth> ~ "'" !! "") ~
".");
" in the @*INC directories.");
pir::exit__vI( 1 ); # or another more meaningful nonzero status
}

# Need not load file if we already did so.
Expand Down

0 comments on commit 32150d5

Please sign in to comment.