{
    "mode": "perldoc",
    "parameter": "Inline::FAQ",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Inline%3A%3AFAQ/json",
    "generated": "2026-06-14T00:16:32Z",
    "sections": {
        "NAME": {
            "content": "Inline-FAQ - The Inline FAQ\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Welcome to the official Inline FAQ. In this case, FAQ means: Formerly Answered Questions\n\nThis is a collection of old, long-winded emails that myself and others have sent to the Inline\nmailing list. (inline@perl.org) They have been reviewed and edited for general Inline\nedification. Some of them may be related to a specific language. They are presented here in a\ntraditional FAQ layout.\n",
            "subsections": []
        },
        "GENERAL INLINE": {
            "content": "Since there is only a handful of content so far, all FAQs are currently under this heading.\n\nHow disposable is a \".Inline\" or \"Inline\" directory?\nI probably need to be more emphatic about the role of \"Inline/\" cache directories. Since they\nare created automatically, they are completely disposable. I delete them all the time. And it is\nfine to have a different one for each project. In fact as long as you don't have \"~/.Inline/\"\ndefined, Inline will create a new \"./Inline\" directory (unless, you've done something to\noverride this automatic process - such as using the DIRECTORY config option, or using the\n\"PERLINLINEDIRECTORY\" environment variable). You can move that to \"./.Inline\" and it will\ncontinue to work if you want togive it more longevity and hide it from view. There is a long\ncomplicated list of rules about how \"[.]Inline/\" directories are used/created. But it was\ndesigned to give you the most flexibility/ease-of-use. Never be afraid to nuke 'em. They'll just\npop right back next time they're needed. :)\n\nWhat is the best way to package Inline code for CPAN?\nThis distribution includes Inline::MakeMaker, described below, which takes special steps during\nthe installation of your module to make sure the code gets compiled and installed, rather than\ncompiled by users at runtime. But, users of your module need to install Inline and the language\nsupport module like Inline::CPP as prerequisites for your module.\n\nA better way to distribute your module is with Inline::Module, which takes special steps to\nremove dependencies on Inline::* and convert it to a plain XS module during the construction of\nyour distribution before you upload it to CPAN. It also integrates easily with Dist::Zilla and\nother modern authoring tools for a more streamlined authoring experience.\n\nWhatever happened to the \"SITEINSTALL\" option?\n\"SITEINSTALL\" is gone. I was going to leave it in and change the semantics, but thought it\nbetter to remove it, so people wouldn't try to use it the old way. There is now \"INSTALL\" (but\nyou're not supposed to know that :). It works magically through the use of Inline::MakeMaker. I\nexplained this earlier but it's worth going through again because it's the biggest change for\n0.40. Here's how to 'permanently' install an Inline extension (Inline based module) with 0.40:\n\n1.  Create a module with Inline.\n\n2.  Test it using the normal / local \"Inline/\" cache.\n\n3.  Create a Makefile.PL (like the one produced by h2xs)\n\n4.  Change 'use ExtUtils::MakeMaker' to 'use Inline::MakeMaker'\n\n5.  In the Makefile.PL's WriteMakefile() insert:\n\nCONFIGUREREQUIRES  =>  {\n'Inline::MakeMaker'     => 0.45,\n'ExtUtils::MakeMaker'   => 6.52,\n},\n\n(See the \"Writing Modules with Inline\" section of Inline.pod for an explanation /\nelaboration.)\n\n6.  Change your 'use Inline C => DATA' to 'use Inline C => DATA => NAME => Foo\n\n=> VERSION => 1.23' + Make sure NAME matches your package name ('Foo'), or => begins with\n'Foo::'. + If you want to quiet a harmless warning that will => appear when the module is loaded\nvia \"require\", do \"Inline->init();\". See => \"Writing Modules with Inline\" in the Inline pod for\ndetails. + Make sure => VERSION matches $Foo::VERSION. This must be a string (not a number) =>\nmatching \"/^\\d\\.\\d\\d$/\" + Do the perl / make / test / install dance => (thanks binkley :)\n\nWith Inline 0.41 (or thereabouts) you can skip steps 3 & 4, and just say \"perl -MInline=INSTALL\n./Foo.pm\". This will work for non-Inline modules too. It will become the defacto standard (since\nthere is no easy standard) way of installing a Perl module. It will allow Makefile.PL parameters\n\"perl - MInline=INSTALL ./Foo.pm - PREFIX=/home/ingy/perl\" and things like that. It will also\nmake use of a MANIFEST if you provide one.\n\nHow do I create a binary distribution using Inline?\nI've figured out how to create and install a PPM binary distribution; with or without\ndistributing the C code! And I've decided to share it with all of you :)\n\nNOTE: Future versions of Inline will make this process a one line command. But for now just use\nthis simple recipe.\n\nThe Inline 0.40 distribution comes with a sample extension module called Math::Simple.\nTheoretically you could distribute this module on CPAN. It has all the necessary support for\ninstallation. You can find it in \"Inline- 0.40/modules/Math/Simple/\". Here are the steps for\nconverting this into a binary distribution without C source code.\n\nNOTE: The recipient of this binary distribution will need to have the PPM.pm module installed.\nThis module requires a lot of other CPAN modules. ActivePerl (available for Win32, Linux, and\nSolaris) has all of these bundled. While ActivePerl isn't required, it makes things (a lot)\neasier.\n\n1.  cd \"Inline-0.40/Math/Simple/\"\n\n2.  Divide Simple.pm into two files:\n\n---8<--- (Simple.pm)\npackage Math::Simple;\nuse strict;\nrequire Exporter;\n@Math::Simple::ISA = qw(Exporter);\n@Math::Simple::EXPORT = qw(add subtract);\n$Math::Simple::VERSION = '1.23';\n\nuse Inline (C => 'src/Simple.c' =>\nNAME => 'Math::Simple',\nVERSION => '1.23',\n);\n1;\n---8<---\n---8<--- (src/Simple.c)\nint add (int x, int y) {\nreturn x + y;\n}\n\nint subtract (int x, int y) {\nreturn x - y;\n}\n---8<---\n\n3.  now you have the Perl in one file and the C in the other. The C code must be\n\nin a subdirectory. + Note that I also changed the term 'DATA' to the name of the C file. This\nwill work just as if the C were still inline. + Run 'perl Makefile.PL' + Run 'make test' + Get\nthe MD5 key from \"blib/arch/auto/Math/Simple/Simple.inl\" + Edit \"blib/lib/Math/Simple.pm\".\nChange \"src/Simple.c\" to \"02c61710cab5b659efc343a9a830aa73\" (the MD5 key)\n\n1.  Run 'make ppd'\n\n2.  Edit 'Math-Simple.ppd'. Fill in AUTHOR and ABSTRACT if you wish. Then\n\nchange:\n\n<CODEBASE HREF=\"\" />\n\nto\n\n<CODEBASE HREF=\"Math-Simple.tar.gz\" />\n\n1.  Run:\n\ntar cvf Math-Simple.tar blib\ngzip --best Math-Simple.tar\n\n2.  Run:\n\ntar cvf Math-Simple-1.23.tar Math-Simple.ppd Math-Simple.tar.gz\ngzip --best Math-Simple-1.23.tar\n\n3.  Distribute Math-Simple-1.23.tar.gz with the following instructions:\n\n1.  Run:\n\ngzip -d Math-Simple-1.23.tar.gz tar xvzf Math-Simple-1.23.tar\n\n2.  Run 'ppm install Math-Simple.ppd'\n\n3.  Delete Math-Simple.tar and Math-Simple.ppd.\n\n4.  Test with:\n\nperl -MMath::Simple -le 'print add(37, 42)'\n\nThat's it. The process should also work with zip instead of tar, but I haven't tried it.\n\nThe recipient of the binary must have Perl built with a matching architecture. Luckily, ppm will\ncatch this.\n\nFor a binary dist with C source code, simply omit steps 2, 3, 6, and 7.\n\nIf this seems too hard, then in a future version you should be able to just type:\n\nmake ppm\n\nWhy does \"C/t/09parser.t\" fail on Cygwin ?\nIt doesn't always fail on Cygwin, but if you find that it produces \"unable to remap .... to same\naddress as parent\" errors during the build phase, then it's time for you to run rebaseall.\n\nSee <http://cygwin.com/faq/faq-nochunks.html#faq.using.fixing-fork-failures> and, if needed,\nseek further help from the Cygwin mailing list.\n",
            "subsections": []
        }
    },
    "summary": "Inline-FAQ - The Inline FAQ",
    "flags": [],
    "examples": [],
    "see_also": []
}