Open? With open, maybe?
Have you tried searching CPAN for a specific module, hoping that one exists?
Ricardo:
We'll need a lot more information than that.
1) Where were the files created?
2) Are you trying to read them on the same system or a different one?
3) Any error messages?
4) Sample code would be nice.
5) What have you tried so far?
PerlMonks is the most helpful place on the 'net. But, you have to do your fair share by asking good questions. Read this: node 172086
I'm not willing to read the whole document about COBOL format, but for registries with fixed size you will probably want to use pack and unpack. For variable size, you can use split, regular expressions and subtr to do the job.
Once you have the abstraction to make the code smart enough to figure out which kind of format it uses, maybe you will want to write a module that reads the file and parses it in an easier way
The first link returned searching for Cobol on search.cpan is [mod://Convert::IBM390] which includes an example for reading a Cobol datafile (not sure what a .cad is though). If you want to read the data printed by the datafile simply set the fd with a filler (see below) then set the filler as a comma or pipe (or other delimiter) and [super search] for reading from a comma delimited file.
fd data-file
LABEL RECORDS ARE STANDARD
DATA RECORD IS data-rec.
01 data-rec.
05 data-foo pic 9(05).
05 data-filler1 pic X(01).
05 data-bar pic X(15).
05 ee-filler2 pic X(01).
* etc....
perlmonks.org content © perlmonks.org and blazar, glasswalk3r, inman, kutsu, pboin, RicardoPortilho, socketdave
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03