~ubuntu-branches/ubuntu/intrepid/horae/intrepid

« back to all changes in this revision

Viewing changes to 0CPAN/STAR-Parser-0.59/bin/dependent.pl

  • Committer: Bazaar Package Importer
  • Author(s): Carlo Segre
  • Date: 2008-02-23 23:13:02 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080223231302-mnyyxs3icvrus4ke
Tags: 066-3
Apply patch to athena_parts/misc.pl for compatibility with 
perl-tk 804.28.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/local/bin/perl -w
2
 
 
3
 
#########################
4
 
#                       # 
5
 
# Script dependent.pl   # 
6
 
# Wolfgang Bluhm, SDSC  #
7
 
#                       #
8
 
#########################
9
 
 
10
 
# writes a list of all dependent item definitions in dictionary
11
 
 
12
 
use STAR::DataBlock;
13
 
use STAR::Dictionary;
14
 
 
15
 
my $dict = STAR::Dictionary->new($ARGV[0]);
16
 
my @saves = $dict->get_save_blocks;   # these describe both items and cats
17
 
 
18
 
my ($save, $mand);
19
 
my (@depend_items, $depend_item); 
20
 
 
21
 
open (OUT, ">$ARGV[1]");
22
 
 
23
 
print OUT "Item\n";
24
 
print OUT "\tDependent items\n";
25
 
print OUT "---------------------------\n\n";
26
 
 
27
 
foreach $save ( @saves ) {
28
 
    if ( $save =~ /\./ ) {    #this is an item
29
 
        @depend_items = $dict->get_item_data(-save=>$save,
30
 
                             -item=>"_item_dependent.dependent_name");
31
 
        if ( $#depend_items >=0 ) {
32
 
            print OUT "$save\n";
33
 
            foreach $depend_item ( @depend_items ) {
34
 
                print OUT "\t$depend_item\n";
35
 
            }
36
 
        }
37
 
    }
38
 
}
39
 
 
40
 
close OUT;
41
 
 
42
 
=head1 DESCRIPTION
43
 
 
44
 
 Reads the saved data structure of a dictionary (.cob file), and outputs 
45
 
 a file with a list of dependent item definitions contained in the dictionary.
46
 
 
47
 
=head1 USAGE
48
 
 
49
 
 perl dependent.pl <dict.cob> <outfile>
50
 
 
51
 
=cut
52