2 Mac::NSGetExecutablePath - Perl interface to the _NSGetExecutablePath
3 darwin (OS X) system call.
10 if ($^O eq 'darwin') {
12 require Mac::NSGetExecutablePath;
13 return Cwd::abs_path(Mac::NSGetExecutablePath::NSGetExecutablePath());
20 This module provides a Perl interface to the "_NSGetExecutablePath"
21 darwin system call. It will only build on darwin systems.
23 Note that if you are using perl 5.16 or greater, then the value of $^X
24 is already computed from the return value of "_NSGetExecutablePath",
25 making this module mostly irrelevant.
29 my $path = NSGetExecutablePath();
31 Returns a string representing the path to the current executable. This
32 path may rightfully point to a symlink.
34 This function may throw exceptions, see "DIAGNOSTICS" for details.
37 "NSGetExecutablePath() wants to return a path too large"
38 This exception is thrown when "_NSGetExecutablePath" requires an
39 outrageously large buffer to return the path to the current executable.
42 The function "NSGetExecutablePath" is only exported on request, either
43 individually or by the tags ':funcs' and ':all'.
48 A C compiler. This module may happen to build with a C++ compiler as
49 well, but don't rely on it, as no guarantee is made in this regard.
51 Exporter (core since perl 5), XSLoader (since 5.006), base (since
58 Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
60 You can contact me by mail or on "irc.perl.org" (vincent).
63 Please report any bugs or feature requests to
64 "bug-mac-nsgetexecutablepath at rt.cpan.org", or through the web
66 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mac-NSGetExecutablePath>
67 . I will be notified, and then you'll automatically be notified of
68 progress on your bug as I make changes.
71 You can find documentation for this module with the perldoc command.
73 perldoc Mac::NSGetExecutablePath
76 Copyright 2012 Vincent Pit, all rights reserved.
78 This program is free software; you can redistribute it and/or modify it
79 under the same terms as Perl itself.