in reply to class::struct compatibility

Sorry... here's code
struct Dlayer => { name => '$', drl_start => '$', drl_end => '$', tool => '%', }; struct Tool => { bit => '$', finish => '$', tol => '$', type => '$', ptholes => '$', count => '$', ar => '%', }; struct AR => { value => '$', ranges => '$', }; sub Dlayer::addtool { my $this = shift; my($s,$bit,$f,$tol,$is_plated,$c,$ar) = @_; my $nt = new Tool; $nt->bit($bit); $nt->finish($f); $nt->tol($tol); $nt->ptholes($is_plated); $nt->count($c); my $h = $this->tool; $h->{$s} = $nt; $this->tool($h); $nt; }

And I access the data like this

#build the drill data structure foreach my $d ( @d_layer_list ) { my $do = new Dlayer; $do->name($d->{name}); $do->drl_start($d->{drl_start}); $do->drl_end($d->{drl_end}); set_d_vals($do,$d->{name}); push(@drill_arr,$do); } foreach my $o ( @drill_arr ) { while (my ($k,$t) = each %{$o->tool} ) { printf SESAME "Drill: %s %s %s %s\n", $o->name, $t->bit, $ +o->drl_start, $o->drl_end; # print SESAME "Drill: $o->{name} $t->{bit} $o->{drl_start +} $o->{drl_end}\n"; print SESAME "\t$drill_str{size} = $k\n"; foreach my $c ( keys %{$t} ) { # print Dumper($c); if ( $OS eq "hpux" ) { printf(SESAME "\t%s = %s\n", $drill_str{$c}, $t->{ +$c}) unless $c eq "ar" || $c eq "bit" || $c eq "type"; } else { my $pruned = $c; $pruned =~ s/Tool:://; printf(SESAME "\t%s = %s\n", $drill_str{$pruned}, +$t->$pruned) unless $pruned eq "ar" || $pruned eq "bit" || $pruned eq + "type"; } } } }

Sorry if I missed something... my brain is really becoming frazzled by this. If I get it to work on one platform I find I have broken something else on the other...