http://www.perlmonks.org?node_id=761179


in reply to EQUIVALENCE Stmt?

I've programmed Fortran for about thirty-five years (I started before the existence of Fortran-77, when FORTRAN didn't have a character data type). I've found the EQUIVALENCE statement to be a major source of buggery and non-portability. Indeed, it was banned in most of the shops in which I worked. I did use it a lot in PLM (product life-cycle management) programming using the Catia CDM/CDS API, and have used it for when I've needed to twiddle bits (yeah, I've done it in Fortran), but I've also had to maintain code where EQUIVALENCEd variables were used to read ASCII flat files, a practice which I believe is hideous, and completely unnecessary.

Use pack and unpack. It's the closest you'll get to Fortran's FORMATted I/O


Information about American English usage here and here. Floating point issues? Please read this before posting. — emc