# this works as a bash include
#
#PRIO 1.1
#COMM Math::GeometNdPoint
#COMM - use constructor new() with array or array reference argument
#COMM - diagnose results with attribute methods dim(), coord(), and string(),
#COMM   including string(-label=>...)
#COMM - output object via &DataPrint
#
function homogaddr {
  perl -n -e 's/(ARRAY|HASH)\(0x\w{5,8}\)/$1(0x123ABC)/; print' "$@"
}
perl -e '
  use lib shift();  # give include precedence to code directory, perl -I would not work!
  use strict;
  use MainLib::Data;
  use Math::GeometNdPoint;
  my $pPt = Math::GeometNdPoint->new(4,1,2,4,5)
    or die "Math::GeometNdPoint construction failed";
  printf "vector dimension: %d\n", $pPt->dim();
  printf "vector coordinates: %s\n", join(q( ),$pPt->coord());
  printf "vector string-formatted: %s\n", $pPt->string();
  print  "--- repeat construction ---\n";
  $pPt = Math::GeometNdPoint->new(4,[1,2,4,5]);
  printf "vector string-formatted, custom label: %s\n", $pPt->string(-label=>q(vector));
  printf "vector via \&DataPrint:\n"; &DataPrint([ $pPt ],-NoMyRef=>1,-space=>2);
  ' -- "$dircode"  \
| homogaddr
