The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<!-- *** Created by pp2html, build 1.21 from PerlPoint-Converters 1.01  -->

<HEAD>

  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="Content-Script-Type" content="text/javascript">
  <link rel="start"    href="slide0029.htm">
  <link rel="prev"     href="slide0038.htm">
  <link rel="next"     href="slide0040.htm">
  <link rel="up"       href="slide0028.htm">
  <link rel="last"     href="slide0052.htm">
  <link rel="contents" href="slide0000.htm">
  <link rel="index"    href="slide_idx.htm">
  <meta name="author" content="cd@conference.org">
  <meta name="description" content="PerlPointCD Demo">
  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
  <meta name="MSSmartTagsPreventParsing" content="true">


<TITLE>Import filters can be added</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="pstyle.css">

<style type="text/css" media="all">
  @import "ahem.css";
  @import "pstyle.css";
</style>

</HEAD>


<p>
Check:
<a href="http://validator.w3.org/check/referer">HTML validity</a>,
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS validity</a>,
<a href="http://validator.w3.org/checklink?uri=http://www.perl-workshop.de/slide0039.htm">links</a>.
</p>

<!-- ************************************************************** -->
<BODY bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#AAAAAA" alink="#FF0000">

<div id=top>
<table border="0" cellspacing="2" cellpadding="0" width="100%">
    
  <tbody>

    <tr>
      <td width="200">
        <a href="http://www.sourceforce.net/projects/perlpoint"><img src="images/PPL13s5b-o.jpg" border=0 alt="PerlPoint"></a>
      </td>
      <td align=center>PerlPointCD<br><i><A HREF="/index.html" TARGET=_top>Start</A> / <a href="slide0027.htm">Lightning Talks</a> / <a href="slide0028.htm">Jochen Stenzel</a></i></td>
    </tr>

  </tbody>

</table>
</div>


<table border="0" cellspacing="0" cellpadding="0" width="100%">

  <tbody>

    <tr valign="bottom">
      <td></td>
      <td></td>
    </tr>

    <tr valign="top">
      <td></td>
      <td></td>
    </tr>

    <tr valign="bottom">
    </tr>

    <tr valign="top">

    <td></td>
    
    <td></td>
    
    <td id=nav width="10%">

 <table width=200>
  <tr><td>&nbsp;</td></tr>
  <tr><td>&gt; <a href="slide0040.htm">Index</a></td></tr>
  <tr><td>&lt; <a href="slide0038.htm">Highlight examples</a></td></tr>
  <tr><td>= <a href="slide0000.htm">TOC</a></td></tr>
  <tr><td>&nbsp;</td></tr>
 </table>

<p class="ahem">You are using an old browser which doesn't fully support
Cascading Style Sheets. This page will look <em>much</em> better in a browser that
supports <a href="http://www.webstandards.org/upgrade/"target="_top"
title="The Web Standards Project's BROWSER UPGRADE initiative.">web
standards</a>.</p>

<p class="ahem">&nbsp;</p>


    </td>
    
    <td></td>
    <td></td>

    <td width="100%" colspan="4">

      <div id=content>
<a name="Import filters can be added">
<center>
<H1>Import filters can be added
</H1></center>


<P>
<A name="index_39_329"></A>
</P>


<P>
Besides <A name="index_39_330"></A>PerlPoint, each source file can be provided in <A name="index_39_331"></A>POD as well. This feature is enabled by a PerlPoint <A name="index_39_332"></A>input filter, which can be compared to the <I><A name="index_39_333"></A>import filters</I> of usual applications.
</P>


<P>
But this feature is not limited to POD - in fact, <I>any</I> <A name="index_39_334"></A><A name="index_39_335"></A>input format can be supported by <I><A name="index_39_336"></A>user defined import filters</I>. A PerlPointCD import filter for a certain <I>format</I> is a Perl file named <CODE><A name="index_39_337"></A>ifilter.&lt;format&gt;</CODE> in an <I><A name="index_39_338"></A>import filter directory</I>, defining a filter function <CODE><A name="index_39_339"></A>&lt;format&gt;2pp()</CODE>.
</P>


<P>
Please note that formats are recognized by file extensions, so the <A name="index_39_340"></A>extension of a filter source file and the extensions of sources in the corresponding format need to be equal.
</P>


<P>
<center>
</P>


<TABLE BORDER=0 CELLPADDING=5 WIDTH=80%><TR><TD bgcolor="#e5e5e5"><PRE>
<FONT COLOR="#000000">
  ifilter.<FONT COLOR=red>pod</FONT> defines a filter
  <FONT COLOR=red>pod</FONT>2pp for *.<FONT COLOR=red>pod</FONT> files.

  ifilter.<FONT COLOR=blue>wi<B>K</B>i</FONT> defines a filter
  <FONT COLOR=blue>wi<B>K</B>i</FONT>2pp for *.<FONT COLOR=blue>wi<B>K</B>i</FONT> files,
  not *.wi<I>k</I>i files.</FONT></PRE></TD></TR></TABLE>


<P>
</center>
</P>


<P>
Writing a filter is easy: a filter function gets the source lines in an <I>array</I> <CODE><A name="index_39_341"></A>@main::_ifilterText</CODE> and supplies a PerlPoint <I>string</I>. See the distributed POD filter for an example.
</P>


<P>
The <A name="index_39_342"></A>filter directory is set up by a <A name="index_39_343"></A>makefile <A name="index_39_344"></A>macro <FONT COLOR=red><CODE><A name="index_39_345"></A>IMPORTFILTERDIR</CODE></FONT>. A second macro, <FONT COLOR=red><CODE><A name="index_39_346"></A>IMPORTORDER</CODE></FONT>, specifies the search order for alternative formats.
</P>


<P>
<center>
</P>


<TABLE BORDER=0 CELLPADDING=5 WIDTH=80%><TR><TD bgcolor="#e5e5e5"><PRE>
<FONT COLOR="#000000">
  <FONT COLOR=green># set up import filters</FONT>
  <FONT COLOR=red>IMPORTFILTERDIR</FONT>=PerlPointCD/ifilters
  <FONT COLOR=red>IMPORTORDER</FONT>=pod twiki kwiki</FONT></PRE></TD></TR></TABLE>


<P>
</center>
</P>


<P>

Index-related:


<UL>
  <li>  <A HREF="slide0034.htm#Configure the make call">Configure the make call</A>  </li> 
</UL>


</P>

    </td>

    <td></td>
    
</tr>

<tr>
    <td></td>
    
    <td></td>
    
    <td id=nav>

    <span class=copy>
      Copyright &copy; <a
      href="mailto:perl@jochen-stenzel.de">Jochen Stenzel, 2001-2004</a>.
      <br>
      <span class=rights>All rights reserved.</span>
    </span>

    </td>

</tr>

<tr>

    <td></td>
    <td></td>

    <td id=nav>

    <span class=pp>
      <br><a href="http://www.sourceforge.net/projects/perlpoint">PerlPoint</a> powered.
    </span>

    </td>

    <td></td>
    <td></td>
    <td width="100%" colspan="4"></td>
    <td></td>
   
    </tr>

  </tbody>

</table>


</div><!-- content -->
</BODY>
</HTML>