libX11 является самой низкой библиотекой уровня для X11. Я полагаю, что opengl/directx говорят с драйвером/аппаратными средствами непосредственно (или эмулируйте неподдерживаемую операцию в секунду), таким образом, они были бы самой низкой библиотекой уровня.
, Если Вы хотите запуститься с очень низкоуровневое программирование, ищите x86 ассемблерный код для VGA и разожгите копию dosbox или подобный.
Try this structure:
bin/Main.pl
lib/Utils/Util1.pm
lib/Utils/Util2.pm
Makefile.PL
MANIFEST
README
t/Utils1.t
t/Utils2.t
As ysth said, make
does not install your modules, it just builds them in a blib
directory. (In your case it just copies them there, but if you had XS code, it would be compiled with a C compiler.) Use make install
to install your modules for regular scripts to use.
If you want to run your script between make
and make install
, you can do:
perl -Mblib bin/Main.pl
The -Mblib
instructs perl to temporarily add the appropriate directories to the search path, so you can try out an uninstalled module. (make test
does that automatically.)
Если вы только начинаете создавать модули Perl (которые также являются эквивалентом Perl проекта ), не используйте Makemaker. Module :: Build - это правильный выбор, и теперь он является частью стандартной библиотеки. Makemaker - это для нас старые соли, которые еще не перешли на Module :: Build. :) Я замечу, что теперь, когда Module :: Build не поддерживается и не используется; Я все еще использую MakeMaker.
Никогда не следует начинать проект Perl с попытки создать структуру самостоятельно. Слишком много работы, и ты всегда что-то забудешь.
Есть h2xs
, программа, которая поставляется с perl
и должна была быть инструментом для преобразования файлов .h в связующий язык Perl XS. Он работает нормально, но его преимущество в том, что он поставляется с perl
:
% h2xs -AXn Module::Name
Что-то вроде Module :: Starter немного сложнее, хотя вы должны получить его из CPAN. Этот инструмент мы используем в Intermediate Perl , потому что он прост. Он заполняет некоторые шаблоны вашей информацией:
% module-starter --author=... --email=... --module=...
Если вы немного это делаете, вы можете затем преобразовать это в Distribution :: Cooker , чтобы вы могли настраивать свои файлы и содержимое. Это изящная утилита, которую я написал для себя, чтобы я мог использовать свои собственные шаблоны.
% dist_cooker Module::Name
Если вы действительно твердо настроены, вам может понадобиться Dist :: Zilla , но это '
Might I also suggest module-starter
? It'll automatically create a skeleton project which "Just Works". I learned what little I know about Perl modules organization by reading the generated skeleton files. It's all well-documented, and quite easy to use as a base for growing a larger project in. You can check out the getting-started docs to see what it gives you.
Running module-starter
will give you a Perl distribution, consisting of a number of modules (use the command line option --module
, such as:
module-starter --distro=Project --module=Project::Module::A,Project::Module::B [...]
to create multiple modules in a single distribution). It's then up to you whether you'd prefer to organize your project as a single distribution consisting of a number of modules working together, or as a number of distributions which can be released separately but which depend on each other (as configured in your Build
or Makefile.PL
file) to provide a complete system.
By default, tests are looked for in a top-level t directory (or a test.pl file, but that has some limitations, so should be avoided).
You say "After I make and run"...make puts things into a blib directory structure ready to be installed, but doesn't do anything special to make running a script access them. (make test is special; it does add appropriate paths from blib to perl's @INC to be able to run the tests.) You will need to do a "make install" to install the modules where your script will find them (or use a tool like PAR to package them together with your script).