Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

B.24. Embedding


The reverse of dynamic loading (in a sense) is

embedding.

Suppose you want to make a really cool word processor, and you start
writing it in (say) C++.[420] Now, you decide you want the
users to be able to use Perl''s regular expressions for an
extra-powerful search-and-replace feature, so you embed Perl into
your program. Then you realize that you could open up some of the
power of Perl to your users. A power user could write a subroutine in
Perl that could become a menu item in your program. Users can
customize the operation of your word processor by writing a little
Perl. Now you open up a little space on your website where users can
share and exchange these Perl snippets, and you''ve got
thousands of new programmers extending what your program can do at no
extra cost to your company. And how much do you have to pay Larry for
all this? Nothing -- see the licenses that come with Perl. Larry is a
really nice guy. You should at least send him a thank-you note.

[420]That''s probably the
language we''d use for writing a word processor. Hey, we love
Perl, but we didn''t swear an oath in blood to use no other
language. When language X is the best choice, use language X. But
often, X equals Perl.


Although we don''t know of such a word processor, some folks
have already used this technique to make other powerful programs. One
such example is Apache''s
mod_perl , which embeds Perl into an
already-powerful web server. If you''re thinking about embedding
Perl, you should check out mod_perl; since
it''s all open source, you can see just how it works.

/ 875