in reply to Re: EQUIVALENCE Stmt?
in thread EQUIVALENCE Stmt?

Dear Corion, pemungkah, johngg, swampyankee, Thank you all so much for the replies.. I guess what I'm after is simply code simplification, the data is all character-based, no binary, i just wanted to do either EQUIVALENCE, or use the VMS Fortran's capability to do STRUCTUREs, so the the first 10 chars of INREC mapped directly to COLUMN1, the next 10 mapped directly to COLUMN2, and so forth. I've already done it with the following snippets.. $CDXCODE = NibbleItOff(8); where NibbleItOff is defined as:
###################################################################### +############### sub NibbleItOff { my $Field_Length = shift; my $Output_String; #print "NibbleItOff>>inrec->$inrec<\n"; print "NibbleItOff>>Field_Leng +th->$Field_Length<\n"; $Output_String = substr( $inrec, 0, $Field_Length ); $inrec = substr( $inrec, $Field_Length ); #print "NibbleItOff>>inrec->$inrec<\n"; print "NibbleItOff>>Output_Str +ing->$Output_String<\n"; return $Output_String; } ###################################################################### +###############
using either EQUIVALENCE, or appropiate STRUCTUREs, that could be eliminated.. Just a passing thought... I'll gladly look up the UNPACK, but it seems to be for binary data, tho.. Thanks for all the hints!!! Jim

Replies are listed 'Best First'.
Re^3: EQUIVALENCE Stmt?
by Brainwavesurfer (Initiate) on May 01, 2009 at 12:59 UTC
    Also Kudos to all the FORTRAN programmers (Or ex-FORTRAN)!!! It was and still is a wonderful language for math as well as whatever else it could do with extensions.. My flavor we used for the longest time was the DEC VAX line.. When we left the VAXen, after a long time of searching, I choose Perl for the next language, as it ran on VAX, PC, Unix, Linux, etc.. (no CP/M, tho! ;-) But that first computer is long gone...) Guess I just dated my self.. Now I've just written my first interface with MS-SQL Server..