The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 03
MANIFEST 35
META.yml 22
SIGNATURE 1113
TEST.gdt 073
lib/GDS2.pm 117169
t/03dump.t 12
t/04dump.t 820
t/04dumpGdt.t 081
t/05close2048.t 640
t/05dump.t 083
t/06close2048.t 064
t/09pod.t 08
t/pod.t 80
14 files changed (This is a version diff) 288503
@@ -1,5 +1,8 @@
 Revision history for Perl extension GDS2 releases
 
+3.32  Better GDT
+3.31  Added GDT test to t/
+3.30  Try to help test problems on Linux machines.
 3.29  Try to help test problems on Linux machines.
 3.28  Try to help test problems on Linux machines.
 
@@ -21,7 +21,9 @@ SIGNATURE
 t/01load.t
 t/02create.t
 t/03dump.t
-t/04dump.t
-t/05close2048.t
-t/pod.t
+t/04dumpGdt.t
+t/05dump.t
+t/06close2048.t
+t/09pod.t
 TEST.dump
+TEST.gdt
@@ -2,7 +2,7 @@
 build_requires: {}
 dynamic_config: 0
 name: GDS2
-version: 3.29
+version: 3.32
 author: [SCHUMACK Ken Schumack]
 abstract: GDS2 stream module
 license: artistic
@@ -17,5 +17,5 @@ distribution_type: module
 provides:
   GDS2:
     file: lib/GDS2.pm
-    version: 3.29
+    version: 3.32
 
@@ -14,7 +14,7 @@ not run its Makefile.PL or Build.PL.
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 f125849dd977a83b93a21a058892146171cdc38d Changes
+SHA1 7b41b3406094b95b57d765514abf5adb954627e0 Changes
 SHA1 333263c693790878e4f248b58a22fb84a9b4e4f4 Examples/README
 SHA1 a5c80b9b4dc4e2f9d89d5440ddcfce94bf4a7b8b Examples/act_folder.xpm
 SHA1 24fecfaa097d2b9c827b6a2e97bc2b48622b08b3 Examples/file.xpm
@@ -28,22 +28,24 @@ SHA1 837331fb7c6b15d605dc9b1d30eb0dda31b74ff6 Examples/testgds2
 SHA1 9363d7e84e78dfd6039497698734b4d27ad1c85e Examples/testgdt
 SHA1 0f924bde4e6b4ae9928d7ec39324dc0a76791815 Examples/textfile.xpm
 SHA1 41aacb1486572bf9d361a1d3b04cd4d3404022bd INSTALL
-SHA1 d9b31cc5888d2cf3a910e281a63eec8a146d3269 MANIFEST
-SHA1 892f6c964554626391c78a72578941c344a19806 META.yml
+SHA1 5fef156746b6a5ca0a269dd5e119b79fd3e9c0b8 MANIFEST
+SHA1 63c952f6d4f9d17f64837a3167a4dbe8945df98b META.yml
 SHA1 ad40c33def87691653d4bc861128387cf4105112 Makefile.PL
 SHA1 ba7c626ff46cf9ebe657c24c25a4688909f9264c README
 SHA1 58426bb60eefa0aee21731d1561bcf96193dcc1f TEST.dump
-SHA1 7dedaac37dcc2f9f442af4bf105fc89a8165dbe1 lib/GDS2.pm
+SHA1 45c6a2566acf72fdd4a77fe57e070c3b2bc956be TEST.gdt
+SHA1 4da1a61f3e09782fa74efb01dff077d3b6f02047 lib/GDS2.pm
 SHA1 054dbd146baf0d4df0bcd74a41a2c691f89325e0 t/01load.t
 SHA1 7f583bf4fe2ba3b7c38459060e5b2a6cc6d3602d t/02create.t
-SHA1 787756215a643e895449c8e4ba85af497d6f123e t/03dump.t
-SHA1 b33a7117b77c30f6afc72028ded05eefb7c341bd t/04dump.t
-SHA1 67ce3487f28b7883732bbe2f816e125b09a9b8cc t/05close2048.t
-SHA1 62c46c14ffe571d3c20867e6891e41606a778078 t/pod.t
+SHA1 90bbd7649034e7fe7ec811c0a6e0fec4f771997c t/03dump.t
+SHA1 bf34339c4e93e6740b113850880e0466f166f7c8 t/04dumpGdt.t
+SHA1 aae31340ba908c6468fbe9596f24495c8f9b1258 t/05dump.t
+SHA1 67ce3487f28b7883732bbe2f816e125b09a9b8cc t/06close2048.t
+SHA1 62c46c14ffe571d3c20867e6891e41606a778078 t/09pod.t
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
-iEYEARECAAYFAlQWWwUACgkQHfVihNMxk4zaSwCdETs+a9tMvYracXpfzqp/RVPp
-iNoAni4JxcYcZLgN6c1Vx7rPS1D7JrUC
-=L7fX
+iEYEARECAAYFAlQXl8UACgkQHfVihNMxk4yCCACdGKiMDM+PCYKEPZLxO/Twh0J8
+7QEAnjPIA7oOOt1vB0NI88/YhDygpoyN
+=WpEJ
 -----END PGP SIGNATURE-----
@@ -0,0 +1,73 @@
+gds2{600
+m=1999-08-11 13:09:15 a=1999-09-15 11:34:10
+lib 'testlib' 0.001 1e-9
+# lines above need to stay as is (read by other tools)
+# http://sourceforge.net/projects/gds2/
+# Key: <required> [optional]
+# File format:
+# gds2{<ver>
+# m=<modificationTimeStamp> a=<accessTimeStamp>
+# lib '<libName>' <userUnits> <dataUnits>
+# <cellDefine>
+# }
+# - - - - -
+# cellDefine is one of more of:
+# cell {c=<creationTimeStamp> m=<modificationTimeStamp> '<cellName>'
+# <cellStuff>*
+# }
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+## <cellStuff>
+# cellStuff is one or more of:
+# boundary:
+# b{<layer> [dt<dataType>] xy(<xyList>) [property]*}
+#
+# path:
+# p{<layer> [dt<dataType>] [pt<pathType>] [w<real>] [bx<real>] [ex<real>] xy(<xyList>) [property]*}
+#
+# text:
+# t{<layer> [tt<textType>] [f<fontType>] [<textJust>] [pt<pathType>] [fx] [w<real>] [m<magification>] [a<angle>] xy(<xyList>) <'text'> [property]*}
+#
+# sref:
+# s{<'cellName'> [fx] [a<angle>] xy(<xyList>) [property]*}
+#
+# aref:
+# a{<'cellName'> [fx] [a<angle>] cr(<columns> <rows>) xy(<xyList>) [property]*}
+#   aref xyList: 1st coord: origin, 2nd coord: X of col * xSpacing + origin, 3rd coord: Y of row * ySpacing + origin
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# property : pr{<propAttr> <'propValue'>}
+# <text> : ASCII String
+# <textJust> : two letter combination of bmt (bottom,middle,top) and rcl (right,center,left) e.g. bl (default is tl)
+# <propAttr> : a 2 byte (small) integer
+# <propValue> : ASCII String
+#
+#     _____
+#    |    a0      x_________        a180    | x             a270
+#    |--                |   |               |        |
+#    |                      |             --|        |___|______
+#  x |                  a90            _____|                   x
+#
+#                   fx a90             _____          __________x
+#  x |    fx                |               |        |   |
+#    |            ______|___|             --|        |
+#    |--          x              fx a180    |            fx a270
+#    |_____                                 | x
+#
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# # as first character on a line is a comment
+cell{c=1998-08-17 14:31:10 m=1998-08-17 14:33:47 'test'
+b{6 xy(1.1 4.2 1.1 1.15 3.9 1.15 3.9 4.2)}
+s{'testcell' xy(2.5 37.125)}
+s{'testcell' fx xy(12.5 37.125)}
+s{'testcell2' xy(112.5 37.125)}
+}
+cell{c=1999-04-20 14:41:04 m=1999-04-22 16:50:39 'testcell'
+b{40 xy(0.9 0.9 0 0.9 0 0 0.9 0)}
+}
+cell{c=1999-08-11 13:00:49 m=1999-08-11 13:00:49 'testcell2'
+b{18 xy(-0.3 -0.3 4.7 -0.3 4.7 0.3 -0.3 0.3)}
+p{16 pt2 xy(-0.425 -0.1 -0.425 -0.425 4.825 -0.425 4.825 0.425 -0.425 0.425 -0.425 0.1)}
+t{59 bl m0.1 xy(89.1 0.9) 'VDD:P'}
+t{59 bl m0.1 xy(84.6 0.9) 'IREF'}
+t{59 br fx m0.1 a90 xy(80.1 0.9) 'IBIAS'}
+}
+}
@@ -1,9 +1,9 @@
 package GDS2;
 {
 require 5.008001;
-$GDS2::VERSION = '3.29';
+$GDS2::VERSION = '3.32';
 ## Note: '@ ( # )' used by the what command  E.g. what GDS2.pm
-$GDS2::revision = '@(#) $Id: GDS2.pm,v $ $Revision: 3.29 $ $Date: 2014-09-14 03:27:57-06 $';
+$GDS2::revision = '@(#) $Id: GDS2.pm,v $ $Revision: 3.32 $ $Date: 2014-09-15 03:27:57-06 $';
 #
 
 =pod
@@ -48,7 +48,8 @@ http://sourceforge.net/projects/gds2/
 # pointed out a endian problem that needed to be addressed.
 #
 # 2014-02-08 modified 02create.t after learning that Joe Walsh was
-# using the test program (gasp) to learn how to use module.
+# using the test program to learn how to use module (please
+# look at examples and POD instead).
 #
 # POD documentation is sprinkled throughout the file in an
 # attempt at Literate Programming style (which Perl partly supports ...
@@ -425,6 +426,7 @@ my %RecordTypeData=(
 # This is the default class for the GDS2 object to use when all else fails.
 $GDS2::DefaultClass = 'GDS2' unless defined $GDS2::DefaultClass;
 
+my $G_gdtString="";
 my $G_epsilon="0.001"; ## to take care of floating point representation problems
 my $G_fltLen=3;
 { #it's own name space...
@@ -439,6 +441,86 @@ $G_epsilon *= 1; #ensure it's a number
 
 ################################################################################
 
+=head1 Examples
+
+  Layer change:
+    here's a bare bones script to change all layer 59 to 66 given a file to
+    read and a new file to create.
+    #!/usr/bin/perl -w
+    use strict;
+    use GDS2;
+    my $fileName1 = $ARGV[0];
+    my $fileName2 = $ARGV[1];
+    my $gds2File1 = new GDS2(-fileName => $fileName1);
+    my $gds2File2 = new GDS2(-fileName => ">$fileName2");
+    while (my $record = $gds2File1 -> readGds2Record)
+    {
+        if ($gds2File1 -> returnLayer == 59)
+        {
+            $gds2File2 -> printLayer(-num=>66);
+        }
+        else
+        {
+            $gds2File2 -> printRecord(-data=>$record);
+        }
+    }
+
+
+  Gds2 dump:
+    here's a complete program to dump the contents of a stream file.
+    #!/usr/bin/perl -w
+    use GDS2;
+    $\="\n";
+    my $gds2File = new GDS2(-fileName=>$ARGV[0]);
+    while ($gds2File -> readGds2Record)
+    {
+        print $gds2File -> returnRecordAsString;
+    }
+
+
+  Gds2 dump in GDT format: which is smaller and easier to parse - http://sourceforge.net/projects/gds2/
+    #!/usr/bin/perl -w
+    use GDS2;
+    my $gds2File = new GDS2(-fileName=>$ARGV[0]);
+    while ($gds2File -> readGds2Record)
+    {
+        print $gds2File -> returnRecordAsString(-compact=>1);
+    }
+
+
+  Create a complete GDS2 stream file from scratch:
+    #!/usr/bin/perl -w
+    use GDS2;
+    my $gds2File = new GDS2(-fileName=>'>test.gds');
+    $gds2File -> printInitLib(-name=>'testlib');
+    $gds2File -> printBgnstr(-name=>'test');
+    $gds2File -> printPath(
+                    -layer=>6,
+                    -pathType=>0,
+                    -width=>2.4,
+                    -xy=>[0,0, 10.5,0, 10.5,3.3],
+                 );
+    $gds2File -> printSref(
+                    -name=>'contact',
+                    -xy=>[4,5.5],
+                 );
+    $gds2File -> printAref(
+                    -name=>'contact',
+                    -columns=>2,
+                    -rows=>3,
+                    -xy=>[0,0, 10,0, 0,15],
+                 );
+    $gds2File -> printEndstr;
+    $gds2File -> printBgnstr(-name => 'contact');
+    $gds2File -> printBoundary(
+                    -layer=>10,
+                    -xy=>[0,0, 1,0, 1,1, 0,1],
+                 );
+    $gds2File -> printEndstr;
+    $gds2File -> printEndlib();
+
+################################################################################
+
 =head1 METHODS
 
 =head2 new - open gds2 file
@@ -504,8 +586,8 @@ sub new
     $self -> {'INDATA'}     = FALSE;     ## in data? flag TRUE | FALSE
     $self -> {'Length'}     = 0;         ## length of data
     $self -> {'DataType'}   = UNKNOWN;   ## one of 7 gds datatypes
-    $self -> {'UUnits'}     = -1.0;      ## for gds2 file
-    $self -> {'DBUnits'}    = -1.0;      ## for gds2 file
+    $self -> {'UUnits'}     = -1.0;      ## for gds2 file  e.g. 0.001
+    $self -> {'DBUnits'}    = -1.0;      ## for gds2 file  e.g. 1e-9
     $self -> {'Record'}     = '';        ## the whole record as found in gds2 file
     $self -> {'RecordType'} = UNKNOWN;
     $self -> {'DataIndex'}  = 0;
@@ -549,15 +631,27 @@ sub endianness
 
 #######
 #private method to clean up number
+sub cleanExpNum($)
+{
+    my $num = shift;
+    $num = sprintf("%0.${G_fltLen}e",$num);
+    $num =~ s/([1-9])0+e/$1e/;
+    $num =~ s/(\d)\.0+e/$1e/;
+    $num;
+}
+################################################################################
+
+#######
+#private method to clean up number
 sub cleanFloatNum($)
 {
     my $num = shift;
     $num = sprintf("%0.${G_fltLen}f",$num);
-    $num =~ s/([1-9])0+$/$1/; 
-    $num =~ s/0\.0+$/0/; 
+    $num =~ s/([1-9])0+$/$1/;
+    $num =~ s/(\d)\.0+$/$1/;
     $num;
 }
-################################################################################ 
+################################################################################
 
 =head2 fileNum - file number...
 
@@ -757,7 +851,9 @@ sub printBgnstr
                     -pathType=>#,
                     -width=>#.#,
                     -unitWidth=>#,    ## (optional) directly specify width in data base units (vs -width which is multipled by resolution)
+
                     -xy=>\@array,     ## array of reals
+                      # -or-
                     -xyInt=>\@array,  ## array of internal ints (optional -wks better if you are modifying an existing GDS2 file)
                   );
 
@@ -913,7 +1009,9 @@ sub printPath
     $gds2File -> printBoundary(
                     -layer=>#,
                     -dataType=>#,
+
                     -xy=>\@array,     ## ref to array of reals
+                      # -or-
                     -xyInt=>\@array,  ## ref to array of internal ints (optional -wks better if you are modifying an existing GDS2 file)
                  );
 
@@ -976,8 +1074,11 @@ sub printBoundary
   usage:
     $gds2File -> printSref(
                     -name=>string,   ## Name of structure
+
                     -xy=>\@array,    ## ref to array of reals
+                      # -or-
                     -xyInt=>\@array, ## ref to array of internal ints (optional -wks better than -xy if you are modifying an existing GDS2 file)
+
                     -angle=>#.#,     ## (optional) Default is 0.0
                     -mag=>#.#,       ## (optional) Default is 1.0
                     -reflect=>0|1    ## (optional)
@@ -1070,8 +1171,11 @@ sub printSref
                     -name=>string,   ## Name of structure
                     -columns=>#,     ## Default is 1
                     -rows=>#,        ## Default is 1
+
                     -xy=>\@array,    ## ref to array of reals
+                      # -or-
                     -xyInt=>\@array, ## ref to array of internal ints (optional -wks better if you are modifying an existing GDS2 file)
+
                     -angle=>#.#,     ## (optional) Default is 0.0
                     -mag=>#.#,       ## (optional) Default is 1.0
                     -reflect=>0|1    ## (optional)
@@ -1187,8 +1291,11 @@ sub printAref
                     -font=>#,       ## 0-3
                     -top, or -middle, -bottom,     ##optional vertical presentation
                     -left, or -center, or -right,  ##optional horizontal presentation
+
                     -xy=>\@array,     ## ref to array of reals
+                      # -or-
                     -xyInt=>\@array,  ## ref to array of internal ints (optional -wks better if you are modifying an existing GDS2 file)
+
                     -x=>#.#,          ## optional way of passing in x value
                     -y=>#.#,          ## optional way of passing in y value
                     -angle=>#.#,      ## (optional) Default is 0.0
@@ -1596,7 +1703,7 @@ sub printGds2Record
     my ($self,%arg) = @_;
 
     my $type = $arg{'-type'};
-    if (! defined $type)
+    unless (defined $type)
     {
         die "printGds2Record expects a type name. Missing -type => 'name' $!";
     }
@@ -2118,7 +2225,7 @@ sub readGds2RecordData
     {
         die "4-byte reals are not supported $!";
     }
-    elsif ($self -> {'DataType'} == REAL_8)  ## 8 byte real
+    elsif ($self -> {'DataType'} == REAL_8)  ## 8 byte real - UNITS, MAG, ANGLE
     {
         my $resolution = $self -> {'Resolution'};
         my $tmpListString = '';
@@ -2303,10 +2410,7 @@ sub returnRecordAsString()
                 $string .= '  '.$bitString;
             }
         }
-        elsif (
-            ($self -> {'DataType'} == INTEGER_2) ||
-            ($self -> {'DataType'} == REAL_8)
-        )
+        elsif ($self -> {'DataType'} == INTEGER_2)
         {
             if ($compact)
             {
@@ -2360,7 +2464,7 @@ sub returnRecordAsString()
             if ($recordType eq 'UNITS')
             {
                 $string =~ s|(\d)\.e|$1e|; ## perl on Cygwin prints "1.e-9" others "1e-9"
-                $string =~ s|(\d)e\-0+|$1e-|; ## different perls print 1e-9 1e-09 1e-009 etc... change to 1e-9
+                $string =~ s|(\d)e\-0+|$1e-|; ## different perls print 1e-9 1e-09 1e-009 etc... standardize to 1e-9
             }
         }
         elsif ($self -> {'DataType'} == INTEGER_4)
@@ -2380,6 +2484,32 @@ sub returnRecordAsString()
                 $string .= ')';
             }
         }
+        elsif ($self -> {'DataType'} == REAL_8)
+        {
+            if ($compact)
+            {
+                $string .= ' ' unless ($string =~ m/ (a|m|pt|dt|tt)$/i);
+            }
+            else
+            {
+                $string .= '  ';
+            }
+            my $num = $self -> {'RecordData'}[$i];
+            if ($num =~ m/e/i)
+            {
+                $num = cleanExpNum($num);
+            }
+            else
+            {
+                $num = cleanFloatNum($num);
+            }
+            $string .= $num;
+            if ($recordType eq 'UNITS')
+            {
+                $string =~ s|(\d)\.e|$1e|; ## perl on Cygwin prints "1.e-9" others "1e-9"
+                $string =~ s|(\d)e\-0+|$1e-|; ## different perls print 1e-9 1e-09 1e-009 etc... standardize to shorter 1e-9
+            }
+        }
         elsif ($self -> {'DataType'} == ACSII_STRING)
         {
             $string .= ' ' if (! $compact);
@@ -2389,6 +2519,22 @@ sub returnRecordAsString()
         $dateFld++ if ($dateFld);
     }
 
+    if ($compact)
+    {
+        $G_gdtString .= $string;
+        if (($G_gdtString =~ m/}$/ || $G_gdtString =~ m/^(gds2|lib|m).*\d$/) || ($G_gdtString =~ m/^cell.*'$/))
+        {
+            $string = "$G_gdtString\n";
+            $string =~ s/{ /{/; #a little more compact
+            $string =~ s/(dt0|pt0|tt0|m1|w0|f0) //g; #these are all default in true GDT format
+            $G_gdtString = "";
+        }
+        else
+        {
+            $string = "";
+        }
+    }
+
     $string;
 }
 ################################################################################
@@ -2415,15 +2561,9 @@ sub returnXyAsArray()
 {
     my($self,%arg) = @_;
     my $asInteger = $arg{'-asInteger'};
-    if (! defined $asInteger)
-    {
-        $asInteger = TRUE;
-    }
+    $asInteger = TRUE unless (defined $asInteger);
     my $withClosure = $arg{'-withClosure'};
-    if (! defined $withClosure)
-    {
-        $withClosure = TRUE;
-    }
+    $withClosure = TRUE unless (defined $withClosure);
     my @xys=();
     if ($self -> isXy)
     {
@@ -2473,16 +2613,13 @@ sub returnXyAsArray()
 sub returnRecordAsPerl()
 {
     my($self,%arg) = @_;
+
     my $gds2File = $arg{'-gds2File'};
-    if (! defined $gds2File)
-    {
-        $gds2File = '$gds2File';
-    }
+    $gds2File = '$gds2File' unless (defined $gds2File);
+
     my $PGR = $arg{'-printGds2Record'};
-    if (! defined $PGR)
-    {
-        $PGR = 'printGds2Record';
-    }
+    $PGR = 'printGds2Record' unless (defined $PGR);
+
     my $string = '';
     $self -> {'UsingPrettyPrint'} = TRUE;
     $string .= getStrSpace() if ($self -> {'RecordType'} != BGNSTR);
@@ -2719,10 +2856,7 @@ sub printDatatype
 {
     my($self,%arg) = @_;
     my $dataType = $arg{'-num'};
-    unless (defined $dataType)
-    {
-        $dataType=0;
-    }
+    $dataType=0 unless (defined $dataType);
     $self -> printGds2Record(-type => 'DATATYPE',-data => $dataType);
 }
 ################################################################################
@@ -4596,88 +4730,6 @@ sub putStrSpace
 
 __END__
 
-=head1 Examples
-
-  Layer change:
-    here's a bare bones script to change all layer 59 to 66 given a file to
-    read and a new file to create.
-    #!/usr/bin/perl -w
-    use strict;
-    use GDS2;
-    my $fileName1 = $ARGV[0];
-    my $fileName2 = $ARGV[1];
-
-    my $gds2File1 = new GDS2(-fileName => $fileName1);
-    my $gds2File2 = new GDS2(-fileName => ">$fileName2");
-
-    while (my $record = $gds2File1 -> readGds2Record)
-    {
-        if ($gds2File1 -> returnLayer == 59)
-        {
-            $gds2File2 -> printLayer(-num=>66);
-        }
-        else
-        {
-            $gds2File2 -> printRecord(-data=>$record);
-        }
-    }
-
-
-  Gds2 dump:
-    here's a program to dump the contents of a stream file.
-    #!/usr/bin/perl -w
-    use GDS2;
-    $\="\n";
-
-    my $gds2File = new GDS2(-fileName=>$ARGV[0]);
-    while ($gds2File -> readGds2Record)
-    {
-        print $gds2File -> returnRecordAsString;
-    }
-
-  Gds2 dump in GDT format (http://sourceforge.net/projects/gds2/) which is easier to parse
-    #!/usr/bin/perl -w
-    use GDS2;
-    $\="\n";
-
-    my $gds2File = new GDS2(-fileName=>$ARGV[0]);
-    while ($gds2File -> readGds2Record)
-    {
-        print $gds2File -> returnRecordAsString(-compact);
-    }
-
-
-  Create a complete GDS2 stream file from scratch:
-    #!/usr/bin/perl -w
-    use GDS2;
-    my $gds2File = new GDS2(-fileName=>'>test.gds');
-    $gds2File -> printInitLib(-name=>'testlib');
-    $gds2File -> printBgnstr(-name=>'test');
-    $gds2File -> printPath(
-                    -layer=>6,
-                    -pathType=>0,
-                    -width=>2.4,
-                    -xy=>[0,0, 10.5,0, 10.5,3.3],
-                 );
-    $gds2File -> printSref(
-                    -name=>'contact',
-                    -xy=>[4,5.5],
-                 );
-    $gds2File -> printAref(
-                    -name=>'contact',
-                    -columns=>2,
-                    -rows=>3,
-                    -xy=>[0,0, 10,0, 0,15],
-                 );
-    $gds2File -> printEndstr;
-    $gds2File -> printBgnstr(-name => 'contact');
-    $gds2File -> printBoundary(
-                    -layer=>10,
-                    -xy=>[0,0, 1,0, 1,1, 0,1],
-                 );
-    $gds2File -> printEndstr;
-    $gds2File -> printEndlib();
-
 =head1 GDS2 Stream Format
 
  #########################################################################################
@@ -44,6 +44,7 @@ close DUMPIN;
 
 my $gds2File = new GDS2(-fileName => 'testdump.gds');
 my $G_epsilon = $gds2File -> getG_epsilon;
+my $G_fltLen = $gds2File -> getG_fltLen;
 open(DUMPOUT,">dump.out") or die "Unable to create dump.out $!";
 while ($gds2File -> readGds2Record)
 {
@@ -65,7 +66,7 @@ while (<DUMPIN>)
     if ($line1 ne $line2)
     {
         $good = 0;
-        print STDERR "\nline $lineCnt> old:$line1 != new:$line2 -> Check your Perl - maybe you only need to adjust your LD_LIBRARY_PATH, but your Perl can not do math very accurately. Developer note: G_epsilon==$G_epsilon\n";
+        print STDERR "\nline $lineCnt> old:$line1 != new:$line2 -> DeveloperNote: G_epsilon==$G_epsilon G_fltLen=$G_fltLen\n";
     }
 }
 close DUMPIN;
@@ -1,82 +0,0 @@
-my $loaded;
-BEGIN { $| = 1; $loaded = 0; print "1..2\n"; }
-use GDS2;
-sub ok
-{
-    my ($n, $result, @info) = @_;
-    if ($result) {
-        print "ok $n\n";
-    }
-    else {
-        print "not ok $n\n";
-        print "# @info\n" if @info;
-    }
-}
-
-$loaded = 1;
-ok(1,$loaded,'problem with GDS2 load.');
-
-open(DUMPIN,"TEST.dump") or die "Unable to read TEST.dump because $!";
-my $gds2FileOut = new GDS2(-fileName => ">testdump.gds");
-my $G_epsilon = $gds2FileOut -> getG_epsilon;
-my $isLittleEndian = $gds2FileOut -> endianness;
-my $dataString;
-while (<DUMPIN>)
-{
-    my $line=$_;
-    $line=~s|^\s+||; ## make following comparisions easier...
-    next if (m|^#|); ## see # as here-to-line-end comment
-    chomp $line;
-    $line=~s|#.*||;
-    $line=~s|$| |g;  ## for match below
-    $dataString='';
-    if ($line =~ m|^([a-z]+) (.*)|i)
-    {
-        my $type=$1;
-        $dataString=$2 if (defined $2);
-        $gds2FileOut -> printGds2Record(-type=>$type,-asciiData=>$dataString)
-    }
-    else
-    {
-        print STDERR "\nWARNING: Unable to parse '$line'\n";
-    }
-}
-$gds2FileOut -> close;
-close DUMPIN;
-
-my $gds2File = new GDS2(-fileName => 'testdump.gds');
-open(DUMPOUT,">dump.out") or die "Unable to create dump.out $!";
-while ($gds2File -> readGds2RecordHeader)
-{
-    $gds2File -> readGds2RecordData();
-    print DUMPOUT $gds2File -> returnRecordAsString."\n";
-}
-close DUMPOUT;
-
-my $good=1;
-open(DUMPOUT,"dump.out") or die "Unable to read dump.out $!";
-open(DUMPIN,"TEST.dump") or die "Unable to read TEST.dump because $!";
-my $lineCnt=0;
-while (<DUMPIN>)
-{
-    $lineCnt++;
-    chomp;
-    my $line1=$_;
-    my $line2 = <DUMPOUT>;
-    chomp $line2;
-    if ($line1 ne $line2)
-    {
-        $good = 0;
-        print STDERR "\nline $lineCnt> old:$line1 != new:$line2 -> Check your Perl - maybe you only need to adjust your LD_LIBRARY_PATH, but your Perl can not do math very accurately. Developer note: G_epsilon==$G_epsilon isLittleEndian==$isLittleEndian\n";
-    }
-}
-close DUMPIN;
-close DUMPOUT;
-if ($good)
-{
-    unlink"testdump.gds";
-    unlink "dump.out";
-}
-ok(2,$good,'problem with ascii dump 2.');
-0;
-
@@ -0,0 +1,81 @@
+my $loaded;
+BEGIN { $| = 1; $loaded = 0; print "1..2\n"; }
+use GDS2;
+sub ok
+{
+    my ($n, $result, @info) = @_;
+    if ($result) {
+        print "ok $n\n";
+    }
+    else {
+        print "not ok $n\n";
+        print "# @info\n" if @info;
+    }
+}
+
+$loaded = 1;
+ok(1,$loaded,'problem with GDS2 load.');
+
+open(DUMPIN,"TEST.dump") or die "Unable to read TEST.dump because $!";
+my $gds2FileOut = new GDS2(-fileName => ">testdump.gds");
+my $dataString;
+while (<DUMPIN>)
+{
+    my $line=$_;
+    $line=~s|^\s+||; ## make following comparisions easier...
+    next if (m|^#|); ## see # as here-to-line-end comment
+    chomp $line;
+    $line=~s|#.*||;
+    $line=~s|$| |g;  ## for match below
+    $dataString='';
+    if ($line =~ m|^([a-z]+) (.*)|i)
+    {
+        my $type=$1;
+        $dataString=$2 if (defined $2);
+        $gds2FileOut -> printGds2Record(-type=>$type,-asciiData=>$dataString)
+    }
+    else
+    {
+        print STDERR "\nWARNING: Unable to parse '$line'\n";
+    }
+}
+$gds2FileOut -> close;
+close DUMPIN;
+
+my $gds2File = new GDS2(-fileName => 'testdump.gds');
+my $G_epsilon = $gds2File -> getG_epsilon;
+my $G_fltLen = $gds2File -> getG_fltLen;
+open(DUMPOUT,">dump.gdt") or die "Unable to create dump.gdt $!";
+my $printLine = "";
+while ($gds2File -> readGds2Record)
+{
+    my $line = $gds2File -> returnRecordAsString(-compact => 1);
+    print DUMPOUT "$line";
+}
+close DUMPOUT;
+
+my $good=1;
+open(DUMPNEW,"dump.gdt") or die "Unable to read dump.gdt $!";
+open(DUMPOLD,"TEST.gdt") or die "Unable to read TEST.gdt because $!";
+READGDT: while (my $line1 = <DUMPOLD>)
+{
+    next READGDT if ($line1 =~ m/^#/); #comment
+    chomp $line1;
+    my $line2 = <DUMPNEW>;
+    chomp $line2;
+    if ($line1 ne $line2)
+    {
+        $good = 0;
+        print STDERR "\nold:$line1 != new:$line2 -> DeveloperNote: G_epsilon==$G_epsilon G_fltLen=$G_fltLen\n";
+    }
+}
+close DUMPOLD;
+close DUMPNEW;
+if ($good)
+{
+    unlink"testdump.gds";
+    unlink "dump.gdt";
+}
+ok(2,$good,'problem with ascii dump.');
+0;
+
@@ -1,64 +0,0 @@
-# Before `Build install' is performed this script should be runnable with
-# `Build test'. After `Build install' it should work as `perl t/02create.t'
-
-######################### We start with some black magic to print on failure.
-
-# Change 1..1 below to 1..last_test_to_print .
-# (It may become useful if the test is moved to ./t subdirectory.)
-
-BEGIN { $| = 1; print "1..2\n"; }
-END {print "not ok 2\n" unless $loaded;}
-use GDS2;
-$loaded = 1;
-print "ok 1\n";
-
-######################### End of black magic.
-
-# Insert your test code below (better if it prints "ok 13"
-# (correspondingly "not ok 13") depending on the success of chunk 13
-# of the test code):
-
-use strict;
-sub ok 
-{
-    my ($n, $result, @info) = @_;
-    if ($result) {
-        print "ok $n\n";
-        unlink "test.gds";
-    }
-    else {
-        print "not ok $n\n";
-        print "# @info\n" if @info;
-    }
-}
-
-my $gds2File = new GDS2(-fileName=>'>test.gds');
-$gds2File -> printInitLib(-name=>'testlib'); 
-$gds2File -> printBgnstr(-name=>'test');
-$gds2File -> printPath(
-                -layer=>6,
-                -pathType=>0,
-                -width=>2.4,
-                -xy=>[0,0, 10.5,0, 10.5,3.3],
-             );
-$gds2File -> printSref(
-                -name=>'contact',
-                -xy=>[4,5.5],
-             );
-$gds2File -> printAref(
-                -name=>'contact',
-                -columns=>2,
-                -rows=>3,
-                -xy=>[0,0],
-             );
-$gds2File -> printEndstr;
-$gds2File -> printBgnstr(-name => 'contact'); 
-$gds2File -> printBoundary(
-                -layer=>10,
-                -xy=>[0,0, 1,0, 1,1, 0,1],
-             );
-$gds2File -> printEndstr;
-$gds2File -> printEndlib();
-$gds2File -> close(-pad=>2048);
-ok 2,(stat("test.gds"))[7] == 2048, 'Size of test.gds looks wrong.';
-
@@ -0,0 +1,83 @@
+my $loaded;
+BEGIN { $| = 1; $loaded = 0; print "1..2\n"; }
+use GDS2;
+sub ok
+{
+    my ($n, $result, @info) = @_;
+    if ($result) {
+        print "ok $n\n";
+    }
+    else {
+        print "not ok $n\n";
+        print "# @info\n" if @info;
+    }
+}
+
+$loaded = 1;
+ok(1,$loaded,'problem with GDS2 load.');
+
+open(DUMPIN,"TEST.dump") or die "Unable to read TEST.dump because $!";
+my $gds2FileOut = new GDS2(-fileName => ">testdump.gds");
+my $G_epsilon = $gds2FileOut -> getG_epsilon;
+my $G_fltLen = $gds2FileOut -> getG_fltLen;
+my $isLittleEndian = $gds2FileOut -> endianness;
+my $dataString;
+while (<DUMPIN>)
+{
+    my $line=$_;
+    $line=~s|^\s+||; ## make following comparisions easier...
+    next if (m|^#|); ## see # as here-to-line-end comment
+    chomp $line;
+    $line=~s|#.*||;
+    $line=~s|$| |g;  ## for match below
+    $dataString='';
+    if ($line =~ m|^([a-z]+) (.*)|i)
+    {
+        my $type=$1;
+        $dataString=$2 if (defined $2);
+        $gds2FileOut -> printGds2Record(-type=>$type,-asciiData=>$dataString)
+    }
+    else
+    {
+        print STDERR "\nWARNING: Unable to parse '$line'\n";
+    }
+}
+$gds2FileOut -> close;
+close DUMPIN;
+
+my $gds2File = new GDS2(-fileName => 'testdump.gds');
+open(DUMPOUT,">dump.out") or die "Unable to create dump.out $!";
+while ($gds2File -> readGds2RecordHeader)
+{
+    $gds2File -> readGds2RecordData();
+    print DUMPOUT $gds2File -> returnRecordAsString."\n";
+}
+close DUMPOUT;
+
+my $good=1;
+open(DUMPOUT,"dump.out") or die "Unable to read dump.out $!";
+open(DUMPIN,"TEST.dump") or die "Unable to read TEST.dump because $!";
+my $lineCnt=0;
+while (<DUMPIN>)
+{
+    $lineCnt++;
+    chomp;
+    my $line1=$_;
+    my $line2 = <DUMPOUT>;
+    chomp $line2;
+    if ($line1 ne $line2)
+    {
+        $good = 0;
+        print STDERR "\nline $lineCnt> old:$line1 != new:$line2 -> DeveloperNote: G_epsilon==$G_epsilon  G_fltLen=$G_fltLen isLittleEndian==$isLittleEndian\n";
+    }
+}
+close DUMPIN;
+close DUMPOUT;
+if ($good)
+{
+    unlink"testdump.gds";
+    unlink "dump.out";
+}
+ok(2,$good,'problem with ascii dump 2.');
+0;
+
@@ -0,0 +1,64 @@
+# Before `Build install' is performed this script should be runnable with
+# `Build test'. After `Build install' it should work as `perl t/02create.t'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..2\n"; }
+END {print "not ok 2\n" unless $loaded;}
+use GDS2;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+use strict;
+sub ok 
+{
+    my ($n, $result, @info) = @_;
+    if ($result) {
+        print "ok $n\n";
+        unlink "test.gds";
+    }
+    else {
+        print "not ok $n\n";
+        print "# @info\n" if @info;
+    }
+}
+
+my $gds2File = new GDS2(-fileName=>'>test.gds');
+$gds2File -> printInitLib(-name=>'testlib'); 
+$gds2File -> printBgnstr(-name=>'test');
+$gds2File -> printPath(
+                -layer=>6,
+                -pathType=>0,
+                -width=>2.4,
+                -xy=>[0,0, 10.5,0, 10.5,3.3],
+             );
+$gds2File -> printSref(
+                -name=>'contact',
+                -xy=>[4,5.5],
+             );
+$gds2File -> printAref(
+                -name=>'contact',
+                -columns=>2,
+                -rows=>3,
+                -xy=>[0,0],
+             );
+$gds2File -> printEndstr;
+$gds2File -> printBgnstr(-name => 'contact'); 
+$gds2File -> printBoundary(
+                -layer=>10,
+                -xy=>[0,0, 1,0, 1,1, 0,1],
+             );
+$gds2File -> printEndstr;
+$gds2File -> printEndlib();
+$gds2File -> close(-pad=>2048);
+ok 2,(stat("test.gds"))[7] == 2048, 'Size of test.gds looks wrong.';
+
@@ -0,0 +1,8 @@
+# Before `Build install' is performed this script should be runnable with
+# `Build test'. After `Build install' it should work as `perl t/01load.t'
+# (It may become useful if the test is moved to ./t subdirectory.)
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
+
@@ -1,8 +0,0 @@
-# Before `Build install' is performed this script should be runnable with
-# `Build test'. After `Build install' it should work as `perl t/01load.t'
-# (It may become useful if the test is moved to ./t subdirectory.)
-use Test::More;
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-all_pod_files_ok();
-