File: test.pl

package info (click to toggle)
ffindex 0.9.9.9-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 488 kB
  • sloc: ansic: 2,382; makefile: 163; perl: 86; python: 56; sh: 21; ruby: 6
file content (26 lines) | stat: -rwxr-xr-x 564 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
#!/usr/bin/env perl

use strict;
use warnings;
use FFindex;

my $ffindex_db = new FFindex("../src/data.ffdata", "../src/data.ffindex");

print "by index:\n";
my $max = $ffindex_db->get_num_entries();
for(my $i = 0; $i < $max; $i++)
{
  my @entry =  @{$ffindex_db->get_entry_by_index($i)};
  print join("\t", @entry), "\n";

  print $ffindex_db->get_data_by_index($i);
}

print "by name:\n";
foreach my $name ("a","b","c")
{
  my @entry =  @{$ffindex_db->get_entry_by_name($name)};
  print join("\t", @entry), "\n";

  print $ffindex_db->get_data_by_name($name);
}