The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

create_segment - read trsd to create segment data

SYNOPSIS

./bin/create_segment.pl

DESCRIPTION

Parse un_edifact/trsd to create segment.{txt,dat.*,rev.*} for further processing in XML::Edifact.pm.

The hash is filled in the following form:

  SEGMT{$segment_tag}=
        "$list_of_codes\t$mand_cond_flags\t".\
        "$name_space:$cooked_name\t$canon_name";

Codes are seperated by blank, and a "MCCCCCCCC" in NAD is not a roman number, but related to the codes and has to tell if a composite or element is mandantory or conditional.

The name is stored twice, once translated ready to use, and once in the orginal form. A revers index is also build as:

  SEGMR{"$name_space:$cooked_name"}=$segment_tag;

This hash is also available as a tab seperated text file, called segment.txt. A segment.xml can serve as a xml representation of the trsd contents.