File: clist2html.pl

package info (click to toggle)
libraw 0.19.2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,396 kB
  • sloc: cpp: 39,147; ansic: 23,363; perl: 145; makefile: 87; sh: 77
file content (54 lines) | stat: -rwxr-xr-x 1,141 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use Data::Dumper;

@makes=( "AgfaPhoto", "Canon", "Casio", "Digital Bolex", "Epson", "Fujifilm", "Imacon",
      "Mamiya", "Minolta", "Motorola", "Kodak", "Konica", "Leica", "Hasselblad",
      "Nikon", "Nokia", "Olympus", "Pentax", "Phase One", "Ricoh",
      "Samsung", "Sigma", "Sinar", "Sony" );

MAINLOOP:
while(<>)
{
  chomp;  
  $cname = $_;
  $cname=~s/^\s+//g;
  $cname=~s/\s+$//g;
  for my $camera (@makes)
  {
     if  ($cname=~/\Q$camera\E\s+(.*)/)
     {
     
 	$model = $1;
        push @{$cameralist->{$camera}},$model;
	next MAINLOOP;
     }    
  }
  if($cname=~/(\S+)\s+(.*)/)
   { 
       ($make,$model) = ($1,$2);
        push @{$cameralist->{$make}},$model;
	next MAINLOOP;
   }
   push @{$cameralist->{$make}},"NO MODEL";
   
}
my $havenx1=0;
print "<ul>\n";
for my $make (sort keys %$cameralist)
{
   if( $#{$cameralist->{$make}} < 1) 
    {
	   print "<li>$make $cameralist->{$make}->[0]</li>\n";

     }
   else
     {
	   print "<li>$make\n<ul>\n";
	   for my $model (@{$cameralist->{$make}})
	    {
	       print "  <li>$model</li>\n";
	    }
	   print "</ul>\n</li>\n";
     }
}
print "</ul>\n";