Cross platform Perl 6 executable path finder (aka which on UNIX)
Branch: master
Clone or download
Latest commit 1dfbeba Apr 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Remove use lib 'lib'; Oct 14, 2017
lib/File Fix return type for which-win32-api Apr 19, 2016
t Fix failing tests on Win10 Apr 8, 2018
.gitignore Change license to MIT. Add AppVeyor (Windows) CI and update Travis CI… Mar 16, 2016
.travis.yml
LICENSE Modernize project (update ci for 2016.12, chmod+x examples, use zef i… Jan 18, 2017
META6.json Fix failing tests on Win10 Apr 8, 2018
README.md Fix markdown typo in README Oct 14, 2017
appveyor.yml Test only on rakudo latest for Travis and AppVeyor CIs Oct 14, 2017

README.md

File::Which

Build Status Build status

This is a Perl 6 Object-oriented port of File::Which (CPAN).

File::Which finds the full or relative paths to an executable program on the system. This is normally the function of which utility which is typically implemented as either a program or a built in shell command. On some unfortunate platforms, such as Microsoft Windows it is not provided as part of the core operating system.

This module provides a consistent API to this functionality regardless of the underlying platform.

use File::Which :whence;

# All perl executables in PATH
say which('perl6', :all);

# First executable in PATH
say which('perl6');

# Same as which('perl6')
say whence('perl6');

Installation

To install it using zef (a module management tool bundled with Rakudo Star):

$ zef install File::Which

Testing

  • To run tests:
$ prove -ve "perl6 -Ilib"
  • To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ TEST_AUTHOR=1 prove -ve "perl6 -Ilib"

Author

Perl 6 port:

A bit of tests:

Perl 5 version:

License

MIT License