my $template = q{
    Szanowny Panie(Pani) $name,

    Otrzymalimy pastwa zamwienie dotyczce $product. Z naszych ustale wynika,
    e bdziemy w stanie dostarczy go do pastwa w dniu $date za cen okoo $cost.

    Dzikujemy za zainteresowanie nasz ofert,

    Acme Integrated Foocorp.
};
---------------------------------
for (@mails) {
    print "%5i %10s %40s %21s\n",
        $_->id,
        substr($_->received,0,10),
        substr($_->from_address,-40,40),
        substr($_->subject,0,21);
}
---------------------------------
for (@mails) {
    print pack("A5 A10 A40 A21\n",
      $_->id, $_->received, $_->from_address, $_->subject);
}
---------------------------------
format STDOUT =
@<<<< @<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<
$_->id $_->received $_->from_address                       $_->subject
.

for (@mails) {
     write;
}
---------------------------------
format STDOUT =
Id      : @<<<<
$_->id
Date    : @<<<<<<<
$_->received
From    : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_->from_address
Subject : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_->subject

.
---------------------------------
Id      : 1                                  Hi Simon, Thank you for the
Date    : 10/12/02                           supply of widgets that you sent
From    : fred@funglyfoobar.com              me last week. I can assure you
Subject : Widgets                            that they have all been put ...
---------------------------------
format STDOUT
Id      : @<<<<                              ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_->id                                       $message
Date    : @<<<<<<<                           ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_->received                                 $message
From    : @<<<<<<<<<<<<<<<<<<<<              ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$_->from_address                             $message
Subject : @<<<<<<<<<<<<<<<<<<<<...             ^<<<<<<<<<<<<<<<<<<<<<<<<<<<...
$_->subject                                  $message

.
---------------------------------
format STDOUT_TOP = 
ID Received From                             Subject
===== ========== ======================================== ====================
.

format STDOUT =
@<<<< @<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<
$_->id $_->received $_->from_address                      $_->subject
.
---------------------------------
Id       : <<<<<
Messagge :
         [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
---------------------------------
Id      : <<<<<   [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
---------------------------------
use Text::Autoformat qw(form);

my $format = <<EOF;
Id      : <<<<<
Date    : <<<<<<<<
From    : <<<<<<<<<<<<<<<<<<<<<
Subject : <<<<<<<<<<<<<<<<<<<<<...
EOF
my $id = 10;
my $date = "20/12/02";
my $from = "Fred Foonly";
my $subject = "Autoformatted message";
print form($format, $id, $date, $from, $subject);
---------------------------------
use Text::Template;
my $template = Text::Template->new(TYPE => "FILE",
                                   SOURCE => "email.tmpl");

my $output = $template->fill_in();
---------------------------------
Drogi {$who},
    Dzikuj Ci za modu {modulename}, ktry pozwoli mi oszczedzi okoo
{$hours) godzin pracy w tym roku. Dziki temu miaem moliwo rozegrania
{ int($hours*2.4) } potyczek w go i bardzo ceni sobie to, e nie straciem
tego czasu, prnujc na IRC-u.

Z powaaniem,
Simon
---------------------------------
use Text::Template;
my $template = Text::Template->new(TYPE => "FILE",
                                   SOURCE => "email.tmpl");

$who = "Mark";
$modulename = "Text::Template";
$hours = 15;
print $template->fill_in();
---------------------------------
use Text::Template;
my $template = Text::Template->new(TYPE => "FILE",
                                   SOURCE => "email.tmpl");

$Temp::who = "Mark";
$Temp:modulename = "Text::Template";
$Temp::hours = 15;
print $template->fill_in(PACKAGE => "Temp");
---------------------------------
use Text::Template;
my $template = Text::Template->new(TYPE => "FILE",
                                   SOURCE => "email.tmpl");

print $template->fill_in(HASH => {
    who = "Mark",
    modulename => "Text::Template",
    hours => 15
});
---------------------------------
$client = "Acme Motorhomes and Eugenics Ltd.";
%jobs =
   ("Zaprojektowanie nowego logo" => 450.00,
    "Papier firmowy" => 300.00,
    "Przeprojektowanie strony WWW"       => 900.00,
    "Inne wydatki" => 33.75
   );
---------------------------------
{my $total=0; ''}
Do ($client}:

Dzikujemy za skorzystanie z usug Fungly Foobar Design Associates.
Oto zestawienie kosztw prac wykonanych w ramach otrzymanego zlecenia:

{
  while (my ($work, $price) = each %jobs) {
      $OUT .= $work . (" " x (50 - length $work)). sprintf("L%6.2f", $price). "\n";
      $total += $price;
  }
}

Koszt cakowity                                  {sprintf "L%6.2f",$total}

Termin patnoci: 30 dni.

Z wyraami szacunku,
Fungly Foobar
---------------------------------
{
  while (my ($work, $price) = each %jobs) {
}

{$work}                                                    L{$price}

{
      $total += $price;
  }
}
---------------------------------
my $template = new Text::Template (TYPE => "FILE",
                                   UNTAINT => 1,
                                   SOURCE => $filename);
---------------------------------
my $compartment = new Safe; # Domylny zestaw operacji jest bezpieczny
$text = $template->fill_in(SAFE => $compatment);
---------------------------------
my $succeeded = 1;

$template->fill_in(BROKEN => \&broken_sub, BROKEN_ARG => \$succeeded);

if (!$suceeded) {
    die "Nie udao si wypeni szablonu...";
}

sub broken_sub {
    my %params = @_;
    ${$params{arg}} = 0;
    undef;
}
---------------------------------
if (browser == "Opera") \{
 ...
\}
---------------------------------
\\textit\{ {$title} \} \\dotfill \\textbf\{ \\${$cost} \}
---------------------------------
\textit{ [[[ $title ]]] } \dotfill \textbf{ [[[ $cost ]]] }
---------------------------------
print $template->fill_in(DELIMITERS => [ '[[[', ']]]' ]);
---------------------------------
{ q{

 if (browser == "Opera") { ... }

} }
---------------------------------
my $template = new Text::Template(...);
$template->fill_in();
---------------------------------
use Text::Template qw(fill_in_file);

print fill_in_file("email.tmpl", PACKAGE => "Q", ...);
---------------------------------
<html>
   <head><title>Informacje o: <TMPL_VAR NAME=PRODUCT></title></head>
   <body>
      <h1> <TMPL_VAR NAME=PRODUCT> </h1>
      <div class="desc">
           <TMPL_VAR NAME=DESCRIPTION>
      </div>
      <p class="price">Cena: $<TMPL_VAR NAME=PRICE></p>
      <hr />
      <p>Cena z dnia <TMP_VAR NAME=DATE></p>
   </body>
</html>
---------------------------------
use strict;
use HTML::Template;

my $template = HTML::Template->new(filename => "catalogue.tmpl");

$template->param( PRODUCT     => "Najwiksza enchilada na wiecie" );
$template->param( DESCRIPTION => $description );
$template->param( PRICE       => 1504.39 );
$template->param( DATE        => format_date(localtime) );

print "Content-Type: text/html\n\n", $template->output;
---------------------------------
<TMPL_IF NAME=PICTURE_URL>
<div class="photo">
    <img src="<TMP_VALUE NAME=PICTURE_URL>" />
</div>
</TMPL_IF>
---------------------------------
<div class="photo">
<TMPL_IF NAME=PICTURE_URL>
   <img erc="<TMP_VALUE NAME=PICTURE_YURL>" />
<TMPL_ELSE>
   <img src="http://www.mysite.com/images/noimage.gif" />
</TMPL_IF>
</div>
---------------------------------
<div class="photo">
   <img src="
<TMPL_VALUE NAME=PICTURE_URL
            DEFAULT="http://www.mysite.com/images/noimage.gif">
   "/>
</div>
---------------------------------
<!-- TMPL_IF NAME=PICTURE_URL -->
<div class="photo">
   <img src="<!-- TMP_VALUE NAME=PICTURE_URL -->" />
</div>
<!-- /TMPL_IF -->
---------------------------------
<ul>
<TMPL_LOOP NAME=STORIES>
    <li> rdo <TMPL_VAR NAME=FEED_NAME>: <TMPL_VAR NAME=STORY_NAME> </li>
</TMPL_LOOP>
</ul>
---------------------------------
<ul>

    <li> rdo Slashdot: NASA Finds Monkeys on Mars </li>

    <li> rdo use.perl: Perl 6 Release Predicted for 2013 </li>

</ul>
---------------------------------
$template->param(STORIES => [
 { FEED_NAME => "Slashdot", STORY_NAME => "Nasa Finds Monkeys on Mars" },
 { FEED_NAME => "use.perl", STORY_NAME => "Perl 6 Release Predicted for 2013" }
]);
---------------------------------
#!/usr/bin/perl

use LWP::Simple;
use XML::RSS;
my @stories;
while (<DATA>) {
    chomp;
    my $xml = get($_) or next;
    my $rss = XML::RSS->new;
    eval { $rss->parse($xml) }; next if $@;
    for my $item (@{$rss->{'items'}}) {
        push @stories, {
             FEED_NAME  => $rss->channel->{'title'},
             FEED_URL   => $rss->channel->{'link'},

             STORY_NAME => $item->{'title'},
             STORY_URL  => $item->{'link'},
             STORY_DESC => $item->{'description'}
             STORY_DATE => $item->{'dc'}->{'date'}
        }
    }
}

@stories = sort { $b->{STORY_DATE} cmp $a->{STORY_DATE} } @stories;

__DATA__
http://slashdot.org/slashdot.rss
http://use.perl.org/perl-news-short.rdf
http://www.theregister.co.uk/tonys/slashdot.rdf
http://blog.simon-cozens.org/blosxom.cgi/xml
http://www.oreillynet.com/~rael/index.rss
---------------------------------
<html>
  <head> <title> Wiadomoci <title> </head>
  <body>
     <h1> Wiadomoci zebrane o <TMPL_VAR TIME> </h1>

     <TMPL_LOOP STORIES>
        <table border="1">
          <tr>
           <td>
             <h2>
               <a href="<TMPL_VAR STORY_URL>"> <TMPL_VAR STORY_NAME> </a>
             </h2>
             <p> <TMPL_VAR STORY_DESC> </p>
             <hr>
             <p> <i> rdo
                 <a href='<TMPL_VAR FEED_URL>"> <TMPL_VAR FEED_NAME> </a>
             </i> </p>
           </td>
          </tr>
        </table>
     </TMPL_LOOP>
  </body>
</html>
---------------------------------
#!/usr/bin/perl

use LWP::Simple;
use XML::RSS;
use HTML::Template;

my @stories;

while (<DATA>) {
    chomp;
    my $xml = get($_) or next;
    my $rss = XML::RSS->new;
    eval { $rss->parse($xml) }; next if $@;
    for my $item (@{$rss->{'items'}}) {
        push @stories, {
             FEED_NAME  => $rss->channel->{'title'},
             FEED_URL   => $rss->channel->{'link'},

             STORY_NAME => $item->{'title'},
             STORY_URL  => $item->{'link'},
             STORY_DESC => $item->{'description'},
             STORY_DATE => $item->{'dc'}->{'date'}
        }
    }
}

my $template = HTML::Template->new(filename => "aggregator.tmpl");

$template->param(STORIES => [
    sort {$b->{STORY_DATE} cmp $a->{STORY_DATE} } @stories
                    ] );
$template->param( TIME=> scalar localtime );

delete $_->{STORY_DATE} for @stories;

print "Content-Type: text/html\n\n", $template->output;

__DATA__
http://blog.simon-cozens.org/blosxom.cgi/xml
http://slashdot.org/slashdot.rss
http://use.perl.org/perl-news-short.rdf
http://theregister.co.uk/tonys/slashdot.rdf
http://www.oreillynet.com/~rael/index.rss
---------------------------------
<& /Header &>
<p>
  Hello World
</p>
<& /Footer &>
---------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
      <title>Some Web Application</title>
      <link rel=stylesheet type="text/css" href="nt.css">
  </head>

<body>
---------------------------------
    <hr>
    <div class="footer">
      <address>
         <a href="mailto:webmaster@yourcompany.com">webmaster@yourcompany.com<'a>
      </address>
    </div>
  </body>
</html>
---------------------------------
     <hr>
     <div class="footer">
       <address>
          <a href="mailto:webmaster@yourcompany.com">webmaster@yourcompany.com</a>
      </address>
      Generated: <%scalar localtime %>
    </div>
  </body>
</html>
---------------------------------
<table>
  <tr>
     <th> key </th>
     <th>value</th>
  </tr>

% for (keys %hash) {
   <tr>
     <td> <% $_%> </td>
     <td> <% $hash{$_} %> %> </td>
   </tr>
% }
</table>

<%ARGS>
%hash => undef
</%ARGS>
---------------------------------
% my %foo = ( one => 1, two => 2 );

<& /Hashdump, hash => %foo &>
---------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">

<head>
<title> My Portal </title>
<link rel="stylesheet" type="text/css" href="/stylesheets/portal.css">
</head>
<body class="pagetable">

<img src="/images/portal-logo.gif" id="toplogo">
<h1>My Portal</h1>
---------------------------------
</body>
</html>
---------------------------------
<& /header &>
<% $m->call_next %>
<& /footer &>
---------------------------------
<table>

<tr>
<td valign="top">
<& /LoginBox &>
<& /Directories &>

<%INIT>
$open = ($open = ~ /(\w+)/) ? $1 : '';
</%INIT>

</td>
<td width=4>&nbsp;</td>

<td width='100%'>

%# Czy jestemy zalogowani?
% if (0) {
<& /LoggedInPane &>
%} elsif ($open) {
<& /DirectoryPane, open => $open &>
%} else {
<& /StandardPane &>
%}
</td>

</table>

<%ARGS>
$open => undef
</%ARGS>
---------------------------------
<table bgcolor="#777777" cellspacing=o border=o cellpadding=o>
<tr><td> rowspan=2></td>
<td valign=middle align=left bgcolor="<%$color%>">
&nbsp;
<font size=-1 color="#ffffff">
<b>
<% $title_href && "<a href=\"$title_href\">"|n%>
<%$title |n %>
<% $title_href && "</a>" |n %>
</b></font></td>
<td rowspan=2>&nbsp;</td></tr>
<tr><td colspan=2 bgcolor="#eeeeee" valign=top align=left width=100%>
<table cellpadding=2 width=100%><tr><td>

<%ARGS>
$title_href => undef>
$title => undef

$color => "#000099"
</%ARGS>
---------------------------------
<% $title_href && "</a>" %>
---------------------------------
</td></tr></table>

</td></tr>
<tr><td colspan=4>&nbsp;</td></tr>
</table>
---------------------------------
<% BoxTop, title=>"Login" &>
<small>Log in to Your portal:</small><br/>
<form>
<ul>
<li> Barcode: <input name="barcode">

<li> Password: <input name="password">

</ul>

</form>
<& BoxEnd &>
---------------------------------
<table bgcolor="#777777" cellspacing=0 border=0 cellpadding=0>
<tr><td> rowspan=2></td>
<td valign=middle align=left bgcolor="#000099">
&nbsp;
<font size=-1 color="#ffffff">
<b> Login </b></font></td>
<td rowspan=2>&nbsp;</td></tr>
<tr><td colspan=2 bgcolor="#eeeeee" valign=top align=left width=100%>
<table cellpadding=2 width=100%><tr><td>
<small>Log in to Your Portal:</small><br/>
<form>
<ul>
<li> Barcode: <input name="barcode">
<li> Password: <input name="password">

</ul>

</form>
</td></tr></table>

</td></tr>
<tr><td colspan=4>&nbsp;</td></tr>
</table>
---------------------------------
<& /BoxTop, title=> "Resources" &>

<ul>
<%$Portal::dirs%>
</ul>
<& /BoxEnd &>

<%ONCE>
    my $root = "/var/portal";
    for my $top (grep { -d $_ } glob("$root*")) {

        $top =~ s/$root//;
        $Portal::dirs .= qq{
            <li><a href="/?open=$top">$top</a>
        } unless $top =~ /\W/;
    }
</%ONCE>
---------------------------------
<%ARGS>
$open
</%ARGS>

% for (grep {-f $_} glob( "/var/portal/$open/*") ) {
% s|/var/portal/||;

<% $m->comp($_) %>
% }
---------------------------------
<& /Technology/01-Register   &>
<& /Technology/02-Slashdot   &>
<& /Technology/03-MacNews    &>
<& /Technology/04-LinuxToday &>
<& /Technology/05-PerlDotCom &>
---------------------------------
<& /BoxTop, title=> "Hello!", color => "dd2222"&>
Welcome to your portal! From here you can subscribe to a wide range of
news and alerting services; if you long in, you can customize this home
page.
<& /BoxEnd &>

<& /Weather/01-Oxford &>
<& /Technology/02-Slashdot &>
<& /News/01-BBC &>
<& /People/03-Rael &>
...
---------------------------------
<7 /RSSBoxd, URL =>"http://www.newsisfree.com/HPE/xml/feeds/60/60.xml",
Color =>"#dd0000" &>
---------------------------------
<& /RSSBox, URL => "http://www.orillynet.com/~rael/index.rss",
Color=> "#cccc00"  Title => "Rael Dornfest", Full => 0 &>
---------------------------------
<%ONCE>
use XML::RSS;
use LWP::Simple;
</%ONCE>
---------------------------------
<%ARGS>
$URL
$Color => "#0000aa"
$Max => 5
$Full => 1
$Title => undef
</%ARGS>
---------------------------------
<%INIT>
return if $m->cache_self(key => $URL, expires_in => '10 minutes');
my $rss = new XML::RSS;
eval { $rss->parse(get($URL));};
my $title = $Title || $rss->channel('title');
</%INIT>
---------------------------------
<%ONCE>
use XML::RSS;
use LWP::Simple;
</%ONCE>

<%ARGS>
$URL
$Color => "#0000aa"
$Max => 5
$Full => 1
$Title => undef
</%ARGS>

<%INIT>
my $rss = new XML::RSS;
eval { $rss->parse(get($URL));};
my $title = $Title || $rss->channel('title');
my $site = $rss->channel('link');
</%INIT>

<BR>
<& BoxTop, color => $Color, title => $title, title_href = $site &>

    <dl class="rss">
% my $count = 0;
% for (@{$rss->{items}}) {
    <dt class="rss">
    <a href="<% $_->{link} %>"> <% $_->{title} %> </a>
    </dt>
% if ($Full) {
    <dd> <% $_->{description} %> </dd>
% }

% last if ++$count >= $Max
% }

    </dl>
<& /BoxEnd &>
---------------------------------
<%INIT>
use LWP::Simple
my @lines = grep /Temperature|Pressure|humidity|^Sun|Rain/,
            split /\n/,
            get('http://www-atm.physics.ox.ac.uk/user/cfinlay/now.htm');
</%INIT>

<br>
<& /BoxTop, title => "Oxford Weather", color => "#dd00dd" &>

<ul>
% for (@lines) {
 <li> <% $_%> </li>
% }
</ul>

<& /BoxEnd &>
---------------------------------
use Template;
my $template = Template->new():
my $variables = {
    who        => "Andy Wardley",
    modulename => "Template Toolkit",
    hours      => 30,
    games      => int(30*2.4)
};
$template->process("thankyou.txt", $variables);
---------------------------------
Drogi [% who %],
    Dzikuj Ci za modu [% modulename %], ktry pozwoli mi oszczedzi okoo
[% hours %] godzin pracy w tym roku. Dziki temu miaem moliwo rozegrania
[% games %] potyczek w go i bardzo ceni sobie to, e nie straciem
tego czasu, prnujc na IRC-u.

Z powaaniem,
Simon
---------------------------------
my $invoice = {
    client => "Acme Motorhomes and Eugenics Ltd.",
    jobs => [
     { cost => 450.00, description => "Zaprojektowanie nowego logo" },
     { cost => 300.00, description => "Papier firmowy" },
     { cost => 900.00, description => "Przeprojektowanie strony WWW" },
     { cost =>  33.75, description => "Inne wydatki" }
    ],
    total => 0
};

$invoice->{total} += $_->{cost} for @{$invoice->{jobs}};
---------------------------------
Do [% client %]

Dzikujemy za skorzystanie z usug Fungly Foobar Design Associates.
Oto zestawienie kosztw prac wykonanych w ramach otrzymanego zlecenia:

[% FOREACH job = jobs %]
     [% job.description %]  : [% job.cost %]
[% END %]

Koszt cakowity                                           $[% total %]

Termin patnoci: 30 dni.

Z wyraami szacunku,
Fungly Foobar
---------------------------------
 [% job.description | format("%60s") %]  : [%job.cost %]
---------------------------------
 [% FILTER html_entity %]
Termin patnoci: < 30 dni.
[% END %]
---------------------------------
 [% IF delinquent %]
   Infomracje w naszej bazie wskazuj, e jest to drugie wezwanie do zapaty. Prosimy o NIEZWOCZNE uregulowanie zalegoci.
[% ELSE %]
   Termin patnoci: < 30 dni.
[% END %]
---------------------------------
 [% USE autoformat(right=78) %]
                                         [% address | autoformat %]
---------------------------------
 [% USE document = XML.Simple("app2ed.xml") %]
Autor tej ksiki to
[% document.bookinfo.authorgroup.author.firstname # 'Simon'  %]
[% document.bookinfo.authorgroup.author.surname   # 'Cozens' %]
---------------------------------
package Template::Plugin::PhoneBill;
use base 'Template::Plugin';
use Data::BT::PhoneBill;
---------------------------------
sub new {
    my ($class, $context, $filename) = @_;
    return Data::BT::PhoneBill->new($filename);
}
---------------------------------
 [% USE bill = PhoneBill("mybill.txt") %]

[% WHILE call = bill.next_call %]
Call made on [% call.date %] to [% call.number %]...
[% END %]
---------------------------------
<table bgcolor="#777777" cellspacing=0 border=0 cellpadding=0>
<tr>
  <td rowspan=2></td>
  <td valign=middle align=left bgcolor="[% color %]">
    &nbsp;
   <font size=-1 color="#ffffff">
   <b>
   [% IF title_href %]
      <a href="[% title_href %]"> [% title %] </a>
   [% ELSE %]
      [% title %]
   [% END %]
   </b>
   </font>
  </td>
  <td rowspan=2>&nbsp;</td>
</tr>
<tr>
  <td colspan=2 bgcolor="#eeeeee" valign=top align=left width=100%>
  <table cellpadding=2 width=100%>
    <tr><td>
---------------------------------
 [% INCLUDE boxtop
           title = "Login"
           ...
%]
---------------------------------
 [% MACRO boxtop INCLUDE boxtop %]
[% MACRO boxend INCLUDE boxend %]
---------------------------------
 [% boxtop(title="My Box") %]
   <P> Hello, people! </P>
[% boxend %]
---------------------------------
 [% MACRO boxtop BLOCK %]
<table bgcolor="#777777" cellspacing=0 border=0 cellpadding=0>
<tr>
  ...
[% END %]

[% MACRO boxend BLOCK %]
</td></tr></table>

</td></tr>
<tr><td colspan=4>&nbsp;</td></tr>
</table>
[% END %]
---------------------------------
package Template::Plugin::XML::RSS::URL;
use base 'Template::Plugin::XML::RSS';
use LWP::Simple;

sub new {
    my ($class, $context, $url) = @_;

return $class->fail('Niepoprawny adres URL') unless $url;

my $url_data = get($url)
  or return $class->fail("Nie udao si pobra danych z $url");

my $rss = XML::RSS->new
  or return $class->fail('Nie udao si utworzy XML::RSS');

eval { $rss->parse($url_data) } and not $@
  or return $class->fail("Bd przy parsowaniu $url: $@");

  return $rss;
}

1;
---------------------------------
 [% MACRO RSSBox(url) USE rss = XML.RSS.URL(url) %]
[% box_top(title = rss.channel.title, title_href = rss.channel.link) %]

<dl class="rss">
[% FOREACH item = news.items %]
    <dt clas="rss">
       <a href="[% item.link  %]"> [% item.title %] </a>
    [% IF full %]
       <dd> [% item.description %] </dd>
    [% END %]
    </dt>
[% END %]
</dl>
[% box_end %]
[% END %]
---------------------------------
 [% RSSBox("http://slashdot.org/slashdot.rss") %]
---------------------------------
<p>
Good
<xsp:logic>
if ((localtime) [2] >= 12) {
    <i>Afternoon</i>
}
else {
    <i>Morning</i>
}
</xsp:logic>
</p>
---------------------------------
<xsp:page
     language="perl"
     xmlns:xsp="http://apache.org/xsp/core/v1"
     xmlns:esql="http://apache.org/xsp/SQL/v2"
>
---------------------------------
<esql:connection>
<esql:driver>Pg</esql:driver>
<esql:dburl>dbname=rss</esql:dburl>
<esql:username>www</esql:username>
<esql:password></esql:password>
<esql:execute-query>
  <esql:query>
    select description, url, title from feeds
  </esql:query>
  <esql:results>
    <ul>
    <esql:row-results>
       <li>
        <a>
         <xsp:attribute name="href">
             <esql:get-string column="url"/>
         </xsp:attribute>
         <esql:get-string column="name"/>
        </a> - <esql-get-string column="description"/>
       </li>
    </esql:row-results>
    </ul>       
  </esql:results>
  <esql:no-results> <p> Nie uzyskano adnego wyniku! </p> </esql:no-results>
</esql:execute-query>
</esql:connection>
