HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/gsutil/third_party/chardet/tests/KOI8-R/forum.template-toolkit.ru.8.xml
<?xml version="1.0" encoding="koi8-r" ?>
<!--
Source: http://forum.template-toolkit.ru/rss/forum_8.rss
Expect: KOI8-R
-->
<rss version='2.0'>
	<channel>
		<title>������ Template Toolkit : ���������� ��� ����� � ������� � Perl</title>
		<link>http://forum.template-toolkit.ru/view_forum/forum_id-8.html?rss</link>
		<description>Template Toolkit - ������, ����� � ��������� ������ �������� �������. � ���� ������ �����, � ������� ���������� ������� ������������ ���������� �� ����� � �������. Text::Template, HTML::Template, Mason � ������ ����������</description>
		<language>ru</language>
		<copyright>Lobanov Igor</copyright>
		<webMaster>Lobanov Igor &lt;webmaster@template-toolkit.ru&gt;</webMaster>
		<pubDate>Thu, 17 Mar 2005 12:03:32 GMT</pubDate>
		<lastBuildDate>Wed,  4 Jan 2006 02:29:01 GMT</lastBuildDate>
		<managingEditor>Perl script, Template Toolkit</managingEditor>
		<image>
			<url>http://forum.template-toolkit.ru/images/tt2powered.gif</url>
			<title>Template Toolkit - ������ � perl</title>
			<link>http://forum.template-toolkit.ru/</link>
			<width>88</width>
			<height>31</height>
		</image>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<item>
			<guid isPermaLink="true">http://forum.template-toolkit.ru/view_topic/topic_id-53.html?rss</guid>
			<pubDate>Tue, 28 Dec 2004 19:07:19 GMT</pubDate>
			<title>��������� ���, ������������, � �����������</title>
			<link>http://forum.template-toolkit.ru/view_topic/topic_id-53.html?rss</link>
			<description>� &lt;a target=&quot;_blank&quot; href=&quot;http://www.theperlreview.com/&quot;&gt;Perl Review&lt;/a&gt; ���������� ����� ���� �� ��� (brian d foy) &amp;quot;Separating Code, Presentation, and Configuration&amp;quot;. ���� ���������� ������� �����.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;������ �����.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;� ���� �������� �� ���������� ����� � ������� ���, ������������ � ����������, ����� ������ �������� ����� ������ � ������ ��� ���������.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;1. ��������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;� ��������� ������� � ��������� ��������, ������ � �������� ��� ����, ����� ������ � �������� Rich Site Summaries (RSS) � ������ ���-�����&lt;span style=&quot;font-weight:bold&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt;. � ���� � ���������� ���������� ��������, ����� ����� ���� ���� ������� � �� ����������� �����, � ����� ��� � ���� ������� � ��� ������.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 1&lt;/span&gt; �������� ��������, ������ � ���������� � ���������� �������. � ������ &lt;span style=&quot;font-weight:bold&quot;&gt;@files&lt;/span&gt; ������� ����, ������� ���������� ��������, &lt;span style=&quot;font-weight:bold&quot;&gt;$base&lt;/span&gt; - �����, ��� ���������� �����, � ��������� �������� &lt;span style=&quot;font-weight:bold&quot;&gt;print&lt;/span&gt; ������ HTML � ����������� ������� ���������� (��� ���������������� ����� ��� ����������� HTML-������� ������ CGI). ��� �������� � ������� ��� ������������� ���. ���� � ����� �������� ������ ����� ��� �����, � ����� ������ ��������, ���� ����� ���-�� ���������� ��� ����� ����� ������.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 1: ��������� RSS � ����������������� ���������.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	#!/usr/bin/perl -w
2	use strict;
3
4	use LWP::Simple;
5	use XML::RSS;
6
7	my @files = qw(
8	  http://use.perl.org/useperl.rss
9	  http://search.cpan.org/rss/search.rss
10	  http://jobs.perl.org/rss/standard.rss
11	  http://www.perl.com/pace/perlnews.rdf
12	  http://www.perlfoundation.org/perl-foundation.rdf
13	  http://www.stonehenge.com/merlyn/UnixReview/ur.rss
14	  http://www.stonehenge.com/merlyn/WebTechniques/wt.rss
15	  http://www.stonehenge.com/merlyn/LinuxMag/lm.rss
16	);
17
18	my $base = '/usr/home/comdog/TPR/rss-html';
19
20	foreach my $url ( @files )
21	  {
22	  my $file = $url;
23
24	  $file =~ s|.*/||;
25
26	  my $result = open my $fh, &amp;quot;&amp;gt; $base/$file.html&amp;quot;;
27
28	  unless( $result )
29	    {
30	    warn &amp;quot;Could not open [$file] for writing! $!&amp;quot;;
31	    next;
32	    }
33
34	  select $fh;
35
36	  my $rss = XML::RSS-&amp;gt;new();
37	  my $data = get( $url );
38	  $rss-&amp;gt;parse( $data );
39
40	  my $channel = $rss-&amp;gt;{channel};
41	  my $image = $rss-&amp;gt;{image};
42
43	  print &amp;lt;&amp;lt;&amp;quot;HTML&amp;quot;;
44	  &amp;lt;table cellpadding=1&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td bgcolor=&amp;quot;#000000&amp;quot;&amp;gt;
45	  &amp;lt;table cellpadding=5&amp;gt;
46	    &amp;lt;tr&amp;gt;&amp;lt;td bgcolor=&amp;quot;#aaaaaa&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;
47	HTML
48
49	  if( $image-&amp;gt;{url} )
50	    {
51	    my $img = qq|&amp;lt;img src=&amp;quot;$$image{url}&amp;quot; alt=&amp;quot;$$channel{title}&amp;quot;&amp;gt;|;
52	    print qq|&amp;lt;a href=&amp;quot;$$channel{link}&amp;quot;&amp;gt;$img&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;\n|;
53	    }
54	  else
55	    {
56	    print qq|&amp;lt;a href=&amp;quot;$$channel{link}&amp;quot;&amp;gt;$$channel{title}&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;\n|;
57	    }
58
59	  print &amp;lt;&amp;lt;&amp;quot;HTML&amp;quot;;
60	  &amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;$$channel{description}&amp;lt;/font&amp;gt;
61	  &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
62	  &amp;lt;tr&amp;gt;&amp;lt;td bgcolor=&amp;quot;#bbbbff&amp;quot; width=200&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;
63	HTML
64
65	  foreach my $item ( @{ $rss-&amp;gt;{items} } )
66	    {
67	    print qq|&amp;lt;b&amp;gt;&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;a href=&amp;quot;$$item{link}&amp;quot;&amp;gt;$$item{title}&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;\n|;
68	    }
69
70	  print &amp;lt;&amp;lt;&amp;quot;HTML&amp;quot;;
71	    &amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
72	  &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;
73	  &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;
74	HTML
75
76	  close $fh;
77	  }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;2. ��������� ������������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;������� ����� �� �������� ���� � ������ ������������� �����. ��� ������� ����� ����� ����� � ������ �� ���������� ����-��, ��� �� ����������� - ��, ��� � ����� � RSS �� ������ ����� �������. � ���� ������� ����������� HTML, TeX, ������� �����, ��� ��� ����-�� �����, ������� �� ���� ���� ����������.&lt;br /&gt;&lt;br /&gt;�������� ���-�� ������ ������ ���������� ������� ��� ����� � �������, �� ��� ������� ������ Text::Template ���-������� ������� (Mark-Jason Dominus). �� ����� ��� ��� ��� ����������, �� ������� ��� ����� ����� �������������� ������� � ����� �������� � Perl. � ���� ������� ��������� � ��� �� ��������� ������ ���� �������, ��������� ������ ��������� Perl.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 2&lt;/span&gt; - ��� � �� �������, ������ ������ ����������� HTML ������������ Text::Template. � ������ 5 � ��������� ����� fill_in_file(). � ������ 13 ������ �����, ������� ���� �����������. ���� HTML, ������������ ���������, ������ ������� � ��� �����, ����������� � &lt;span style=&quot;font-style:italic&quot;&gt;�������� 3&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;������ Text::Template ����� �������� ����� �� ���. ���� ��� ��������� ������ ���������� � ������, � ������� - ��������� ���������� �����, � ���� ��������� ��� ����������. ���� ������� ��� ������� �����, ��������� ����� �����. ���� ������� ��� - ��������� �����, ��������� ����� - �����, � �� ����.&lt;br /&gt;&lt;br /&gt;������, ��������� XML::RSS - ��������� ���. ������ ������������ ���������� ��������� ��� �������, �� �� ��� ������. ��� ������ ������ ��, ��� � ������ ������� ����� ������. � ������ &lt;span style=&quot;font-weight:bold&quot;&gt;$rss-&amp;gt;channel&lt;/span&gt;, ������ � ������� ������� �������� ��������� ���, ��������� &lt;span style=&quot;font-weight:bold&quot;&gt;%channel&lt;/span&gt;, � &lt;span style=&quot;font-weight:bold&quot;&gt;$rss-&amp;gt;items&lt;/span&gt;, �������� ��������� ����� ��������� &lt;span style=&quot;font-weight:bold&quot;&gt;@items&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 2: ������������ �����.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	#!/usr/bin/perl -w
2	use strict;
3
4	use LWP::Simple;
5	use Text::Template qw(fill_in_file);
6	use XML::RSS;
7
8	my @files = qw(
9	  http://use.perl.org/useperl.rss
10	);
11
12	my $base = '.';
13	my $template = 'rss-html.tmpl';
14
15	foreach my $url ( @files )
16	  {
17	  my $file = $url;
18
19	  $file =~ s|.*/||;
20
21	  my $result = open my $fh, &amp;quot;&amp;gt; $base/$file.html&amp;quot;;
22
23	  unless( $result )
24	    {
25	    warn &amp;quot;Could not open [$file] for writing! $!&amp;quot;;
26	    next;
27	    }
28
29	  my $rss = XML::RSS-&amp;gt;new();
30	  my $data = get( $url );
31	  $rss-&amp;gt;parse( $data );
32
33	  print fill_in_file( $template, HASH =&amp;gt; $rss );
34	  close $fh;
35	  }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;������ ����� Text::Template ��������� ����� ���, ������� �� ������ ����� ��������� �������. �� ������� ���� ��������� ����������� ���������. ���� ���������� - ���� ���, ������ � ������� � ������ � ������� �������� ������� fill_in_file() � ����, ����������� � &lt;span style=&quot;font-style:italic&quot;&gt;�������� 2&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 3: HTML �����.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	&amp;lt;table cellpadding=1&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td bgcolor=&amp;quot;#000000&amp;quot;&amp;gt;
2	&amp;lt;table cellpadding=5&amp;gt;
3	  &amp;lt;tr&amp;gt;
4	    &amp;lt;td bgcolor=&amp;quot;#aaaaaa&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;
5	    &amp;lt;a href=&amp;quot;{ $channel{link} }&amp;quot;&amp;gt;{
6
7	    $image ? qq|&amp;lt;img src=&amp;quot;$image&amp;quot; alt=&amp;quot;$channel{title}&amp;quot;&amp;gt;| : $channel{title}
8
9	    }&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;
10
11	    { $channel{description} }
12	    &amp;lt;/td&amp;gt;
13	  &amp;lt;/tr&amp;gt;
14
15	  &amp;lt;tr&amp;gt;
16	    &amp;lt;td bgcolor=&amp;quot;#bbbbff&amp;quot; width=200&amp;gt;&amp;lt;font size=&amp;quot;-1&amp;quot;&amp;gt;
17	{
18	    my $str;
19
20	    foreach my $item ( @items )
21	      {
22	      $str .= qq|&amp;lt;b&amp;gt;&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;a href=&amp;quot;$$item{link}&amp;quot;&amp;gt;$$item{title}&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;\n|;
23	      }
24
25	    $str;
26	}&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;
27	  &amp;lt;/tr&amp;gt;
28	&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;
29	&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;�� ������ ������ ������� ���������, � ���� ������ ������������ �� ����� ������ ���. ���� � ����� ������� �������� ��� ������������ �����, � ������ ������ �����. ���� ��� ������ HTML ��������� ������� �����, � ������ ����� ��� ����� ����� �����, �� ��� ������ � &lt;span style=&quot;font-style:italic&quot;&gt;�������� 4&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 4: ������ ��� �������� �����.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	{ $channel{title} }
2
3	{ $channel{description} }
4
5	{
6	my $str;
7
8	foreach my $item ( @items )
9	  {
10	  $str .= qq|* $$item{title}\n|;
11	  }
12
13	$str;
14	}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;3. ��������� �����������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;������� ����� ���� ��������� ���������� ������ � ��������� ��������. � &lt;span style=&quot;font-style:italic&quot;&gt;�������� 1&lt;/span&gt; � ������ ������� ������� ���������� ��� �����, ��� ����� ��� ������ ������� - ���� ��� ������� ���������� ����������, ������ ��������. ����� ���� &lt;span style=&quot;font-style:italic&quot;&gt;� �������� 2&lt;/span&gt; ������ �������� ��� �����, �������� � �� ��� � ���� ������ ������������, ������� �����. ��� ����� ����� ����������� ���� ������ ������ ������������� ��� ������ ������������ ������ � ���� �� ����� ��� ������ �����������.&lt;br /&gt;&lt;br /&gt;������ ��������-��������� �������, ������� � ���� � �������� ������, ����� ����������� ������������ ������ ���� ������ ��� ������� ����������, ������ �������� ������ ��������������� �����. ���� ������ �������, ����� �������� ����������� ��� ������ ���� �������������� � ����� ������ - ����� ������ ������. ������ ��������������� ����� ����� �������� � ���������� ���������, �� ��� �� ������� ��������.&lt;br /&gt;&lt;br /&gt;� ���� ����� ������� ��������������� ����� ����������� �������� � ����� ������ ���� �� ���. ����� Comprehensive Perl Archive Network (CPAN)&lt;span style=&quot;font-weight:bold&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/span&gt; �������� ��������� ������� ��� ����� ��������������� ����� � �������� ������ ��� ���������� �������� ������. �������� ������ ������� ������, ������� ������������� �� �����.&lt;br /&gt;&lt;br /&gt;���� � ������� ��� �������� ����� ����������� �� ���� ��������, � ������� ��������� ������� � CPAN � ���������� � ConfigReader::Simple, ������� ���������� ���������� ����� ���-�������. � ���������� ��� �������� ����, ��� ��� ��������� ��� ��������� ���� ������� (Bek Oberin), ������ ����������� ������, ���� �������� ���� � ���� ��������� ������.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 5&lt;/span&gt; ��������� &lt;span style=&quot;font-style:italic&quot;&gt;������� 2&lt;/span&gt; � ����������� ConfigReader::Simple. � ����� ����� ������ �����������, ���� ���� ������� �� ������. ������ ���������� ���� ����� ����������� � ���� ������� ��� �������� ������ (���� ��� ������ � �������� ����� � ������������� ������, ������� �� ����� ���� ����������� � ������������� Perl ���������� ����������� ����� get()). &lt;span style=&quot;font-style:italic&quot;&gt;������� 6&lt;/span&gt; �������� ��������������� ���.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 5: ������������ ConfigReader::Simple.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	#!/usr/bin/perl -w
2	use strict;
3
4	use ConfigReader::Simple;
5	use LWP::Simple;
6	use Text::Template qw(fill_in_file);
7	use XML::RSS;
8
9	my $config = ConfigReader::Simple-&amp;gt;new( './rss.config' );
10
11	my $base = $config-&amp;gt;base;
12	my $template = $config-&amp;gt;template;
13	my $extension = $config-&amp;gt;extension;
14
15	my @files = split /\s+/, $config-&amp;gt;files;
16
17	foreach my $url ( @files )
18	  {
19	  my $file = $url;
20
21	  $file =~ s|.*/||;
22
23	  my $result = open my $fh, &amp;quot;&amp;gt; $base/$file.$extension&amp;quot;;
24
25	  unless( $result )
26	    {
27	    warn &amp;quot;Could not open [$file] for writing! $!&amp;quot;;
28	    next;
29	    }
30
31	  my $rss = XML::RSS-&amp;gt;new();
32	  my $data = get( $url );
33	  $rss-&amp;gt;parse( $data );
34
35	  print $fh fill_in_file( $template, HASH =&amp;gt; $rss );
36	  close $fh;
37	  }&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic&quot;&gt;������� 6: ��� �����������.&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre&gt;1	base .
2	template rss-html.tmpl
3	files http://use.perl.org/useperl.rss
4	extension html&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;4. ���������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;� ���� ��������� ����� ���� �������, ������� ��� �� ������ ������������ � ��������������� ���������. ��� ��������� ����� �������� ����� ������ � ������� � ������� � ����� ����������. ������� �������� �������� �����, � ��������������� ���� �������� ������ ��������  ��� ��������� ���. Text::Template � ConfigReader::Simple ����� ��� �������� �������, �������� ��������.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;5. ������&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;��� ������, ���������� � ���� �����, ����� ���� � Comprehensive Perl Archive Network (CPAN) - &lt;a target=&quot;_blank&quot; href=&quot;http://search.cpan.org&quot;&gt;http://search.cpan.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;6. �� ������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;���� �� ��� (brian d foy) - ������� &lt;span style=&quot;font-style:italic&quot;&gt;The Perl Review&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;���������.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/span&gt; &amp;quot;Simple RSS with Perl&amp;quot; by brian d foy, The Perl Review v0 i5, November 2002, &lt;a target=&quot;_blank&quot; href=&quot;http://www.theperlreview.com&quot;&gt;http://www.ThePerlReview.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/span&gt; &lt;a target=&quot;_blank&quot; href=&quot;http://search.cpan.org&quot;&gt;http://search.cpan.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://www.theperlreview.com/Articles/v0i7/config.pdf&quot;&gt;������� ����� � Perl Review (PDF)&lt;/a&gt;
			</description>
			<author>������ ����� &lt;authors@template-toolkit.ru&gt;</author>
			<comments>http://forum.template-toolkit.ru/view_topic/topic_id-53.html</comments>
			<category>������ ����, �������� � ������� � Perl</category>
			<source url="http://forum.template-toolkit.ru/rss/forum_id-8.rss">http://forum.template-toolkit.ru/view_topic/topic_id-53.html?rss</source>
		</item>
	</channel>
</rss>