use strict; use Inline 'SLang'; my $s = get_struct("foo"); print "get_struct() returned a $s - and ref(\$s) = " . ref($s) . "\n\n"; print "Structure contents:\n"; while ( my ( $key, $value ) = each %{$s} ) { print " key $key\t has a value of $value\n"; } print "\n"; $$s{afield} = 'a changed field value'; print "Key afield now has a value of [$$s{afield}]\n"; __END__ __SLang__ typedef struct { xfield, afield } Example_Struct; define get_struct(x) { variable out = @Example_Struct; out.xfield = x; out.afield = strlen(x); return out; }