11 my $db = PciIds::DBQAny::new( connectDb(), {
12 'list' => 'SELECT id, name, note FROM locations WHERE id like "PC/%" OR id like "PD/%" ORDER BY id'
15 my $lastInvalid = undef;
17 foreach( @{$db->query( 'list', [] )} ) {
18 my( $id, $name, $description ) = @{$_};
19 next if defined $lastInvalid and substr( $id, 0, length $lastInvalid ) eq $lastInvalid;
20 if( !defined $name || $name eq '' ) {
25 my $prefix = ( /^PD\/..$/ ) ? 'C ' : '';
31 $id =~ s/([0-9a-f]{4})([0-9a-f]{4})/$1 $2/;
32 print "$tabs$prefix$id $name\n";
33 if( defined( $description ) && ( $description ne '' ) ) {
35 $description =~ s/\n/\n$tabs#/g;
36 print "$tabs# $description\n";