Code Comments
Programming Forum and web based access to our favorite programming groups.> -----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 > i order, > unless i.e. >=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.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.