File: ex2.pl

package info (click to toggle)
libxml-dt-perl 0.69-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 388 kB
  • sloc: perl: 1,432; xml: 438; makefile: 16
file content (29 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

use XML::DT ;
use Data::Dumper;

my $filename = shift;

%xml2=('foto'    => sub{$ind{$isa}= [@{$ind{$isa}},$url]; 
                        $isa=$url="";
                        "<li> $c"},
       'url'     => sub{$url=$c;"<a href=\"$c\">$c</a>"},
       'isa'     => sub{$isa=lc($c);$c},
       'author'  => sub{uc($c) },
       'resol'   => sub{""},
       'arq'     => sub{"Indice\n". Dumper(\%ind) . "----------\n$c"},
       '-default'=> sub{"$q:$c"},
       '-outputenc' => 'ISO-8859-1'
     );

%xml=( 'music'    => sub{"Autor da musica: $c"},
       'musica'   => sub{"--------------(AMP)--------\n$c"},
       'lyrics'   => sub{"Autor da letra:$c"},
       'title'    => sub{ uc($c) . $v{acordes} },
       '-default' => sub{"$q:$c"},
       'arquivo'  => sub{("_" x 60). dt($v{file},%xml2)},
       '-outputenc' => 'ISO-8859-1'
     );

print dt($filename,%xml);