<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
              "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
<chapter id="chapter-perl5">
	<title>Perl5 Plugins</title>

	<warning>
		<para>
			You <emphasis role="strong">MUST</emphasis> have the Perl5 loader
			plugin installed and working as well as the gobject-introspection
			package for GPlugin installed to use Perl5 plugins.
		</para>
	</warning>

	<simplesect>
		<title>Example Perl5 Plugin</title>

		<para>
			Like all plugins in GPlugin, Perl5 plugins must also implement
			the <code>gplugin_query</code>, <code>gplugin_load</code>, and
			<code>gplugin_unload</code> functions.
		</para>

		<para>
			The following is a basic Perl5 plugin.
		</para>

		<informalexample><programlisting>
		use strict;

		use Glib::Object::Introspection;

		Glib::Object::Introspection->setup(basename => "GPlugin", version => "1.0", package=> "GPlugin");

		sub gplugin_query {
			return GPlugin::PluginInfo->new(
				id => "gplugin/perl5-basic-plugin",
				abi_version => 0x01020304,
				name => "basic plugin",
				authors => ("author1"),
				category => "test",
				version => "version",
				license_id => "license",
				summary => "summary",
				website => "website",
				description => "description",
			);
		}

		sub gplugin_load {
			return 0;
		}

		sub gplugin_unload {
			return 0;
		}
		</programlisting></informalexample>
	</simplesect>
</chapter>
