| Jose Nyimi 2004-08-07, 8:55 am |
|
> -----Message d'origine-----
> De=A0: Randy W. Sims [mailto:randys@thepierianspring.org]
> Envoy=E9=A0: samedi 7 ao=FBt 2004 02:50
> =C0=A0: cjbottaro@alumni.cs.utexas.edu
> Cc=A0: beginners@perl.org
> Objet=A0: Re: iterate over the fields of a struct?
>=20
> Christopher J. Bottaro wrote:
> order
>=20
> No. You could store the data used to generate the struct, and then use
> it later.
>=20
> my @struct_data =3D [
> key1 =3D> 'type',
> key2 =3D> 'type',
> ];
>=20
> struct Name =3D> \@struct_data;
>=20
> then iterate of @struct_data...
>=20
did you meant:
my $struct_data =3D [ #array_ref
key1 =3D> 'type',
key2 =3D> 'type',
];
struct Name =3D> $struct_data;
then iterate of @$struct_data ...
?
array =3D array_ref is confusing to me ...
could you explain please ?
that[color=darkred]
> i
order,[color=darkred]
> unless
i.e.[color=darkred]
>=20
> If you're using version 5.8 or later you can use restricted hashes.
See
> `perldoc Hash::Util`
>=20
helpfull module !
Hash vivification is a nightmare, really ...
Jos=E9.
|